<?php $__env->startSection('title', $page_title); ?>

<?php $__env->startSection('css'); ?>
    <link rel="stylesheet" href="<?php echo e(asset('dashboard/css/pages/properties/index.css')); ?>">
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>


    <?php if (isset($component)) { $__componentOriginal342b33bfa6f7d125441314a0164864e25786c1fa = $component; } ?>
<?php $component = App\View\Components\Dashboard\LinksBar::resolve(['links' => [
        [
            'name' => $page_title,
        ],
    ]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('dashboard.links-bar'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(App\View\Components\Dashboard\LinksBar::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal342b33bfa6f7d125441314a0164864e25786c1fa)): ?>
<?php $component = $__componentOriginal342b33bfa6f7d125441314a0164864e25786c1fa; ?>
<?php unset($__componentOriginal342b33bfa6f7d125441314a0164864e25786c1fa); ?>
<?php endif; ?><!-- links bar  -->


    <section id="properties">
        <div class="row justify-content-center">

            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('properties_allow_search')): ?>
                <div id="search-box" class="col-lg-3">
                    <div class="sticky-top">
                        <?php
                            $appendReset = null;
                            if (!empty($filters)) {
                                $appendReset =
                                    '<a href=' .
                                    route('properties.index') .
                                    " class='btn btn-light border btn-sm float-left'>الغاء البحث</a><div class='clearfix'></div>";
                            }
                        ?>

                        <?php if (isset($component)) { $__componentOriginal91e80a119f881aea9c6213b3256cb8b2f369ed09 = $component; } ?>
<?php $component = App\View\Components\PanelWithHeading::resolve(['title' => 'بحث متقدم '.$appendReset.''] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('panel-with-heading'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(App\View\Components\PanelWithHeading::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>

                            <form action="<?php echo e(route('properties.index')); ?>" method="GET" enctype="multipart/form-data">

                                <div class="form-group mb-3">
                                    <label for="title" class=" d-flex justify-content-between">
                                        <span>بحث بالعنوان</span>
                                        <?php if(request('title')): ?>
                                            <button type="button" data-field=".input-title"
                                                class="btn-clear font-13 text-danger float-left">
                                                حذف القيمة
                                            </button>
                                        <?php endif; ?>
                                    </label>
                                    <input type="text" name="title" value="<?php echo e(request('title')); ?>"
                                        class="form-control input-title" placeholder="مثال : شقة للبيع">
                                </div><!-- title -->

                                <div id="search-fields">

                                    <div class="form-group mb-3 <?php echo e(request('neighborhood_id') == null ? 'd-none' : ''); ?>"
                                        data-field="neighborhood">
                                        <label for="neighborhood_id" class=" d-flex justify-content-between">
                                            <span>الحي</span>
                                            <button type="button" class="btn-close font-13 text-danger float-left"
                                                data-hide="neighborhood">
                                                <i class="fa-solid fa-xmark"></i>
                                                إلغاء
                                            </button>
                                        </label>
                                        <select name="neighborhood_id" id="neighborhood_id" class="form-control select2-field">
                                            <option value="">اختر الحي</option>
                                            <?php $__currentLoopData = $neighborhoods; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $neighborhood): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option value="<?php echo e($neighborhood->id); ?>"
                                                    <?php echo e(request('neighborhood_id') == $neighborhood->id ? 'selected' : ''); ?>>
                                                    <?php echo e($neighborhood->name); ?></option>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </select>
                                    </div><!-- neighborhood -->

                                    <div class="form-group mb-3 <?php echo e(request('property_type_id') == null ? 'd-none' : ''); ?>"
                                        data-field="property_type">
                                        <label class="d-flex justify-content-between align-items-center">
                                            <span>نوع العقار</span>
                                            <button type="button" class="btn-close font-13 text-danger float-left"
                                                data-hide="property_type">
                                                <i class="fa-solid fa-xmark"></i>
                                                إلغاء
                                            </button>
                                        </label>
                                        <select name="property_type_id" id="property_type_id"
                                            class="form-control select2-field">
                                            <option value="">اختر النوع</option>
                                            <?php $__currentLoopData = $propertyTypes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $type): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option value="<?php echo e($type->id); ?>"
                                                    <?php echo e(request('property_type_id') == $type->id ? 'selected' : ''); ?>>
                                                    <?php echo e($type->name); ?></option>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </select>
                                    </div><!-- property_type -->

                                    <div class="form-group mb-3 <?php echo e(request('property_status_id') == null ? 'd-none' : ''); ?>"
                                        data-field="property_status">
                                        <label class="d-flex justify-content-between align-items-center">
                                            <span>حالة العقار</span>
                                            <button type="button" class="btn-close font-13 text-danger float-left"
                                                data-hide="property_status">
                                                <i class="fa-solid fa-xmark"></i>
                                                إلغاء
                                            </button>
                                        </label>
                                        <select name="property_status_id" id="property_status_id"
                                            class="form-control select2-field">
                                            <option value="">اختر الحالة</option>
                                            <?php $__currentLoopData = $propertyStatuses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $status): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option value="<?php echo e($status->id); ?>"
                                                    <?php echo e(request('property_status_id') == $status->id ? 'selected' : ''); ?>>
                                                    <?php echo e($status->name); ?></option>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </select>
                                    </div><!-- property_status -->

                                    <div class="form-group mb-3 <?php echo e(request('furnishing_status_id') == null ? 'd-none' : ''); ?>"
                                        data-field="furnishing_status">
                                        <label class="d-flex justify-content-between align-items-center">
                                            <span> حالة التأسيس</span>
                                            <button type="button" class="btn-close font-13 text-danger float-left"
                                                data-hide="furnishing_status">
                                                <i class="fa-solid fa-xmark"></i>
                                                إلغاء
                                            </button>
                                        </label>
                                        <select name="furnishing_status_id" id="furnishing_status_id"
                                            class="form-control select2-field">
                                            <option value="">اختر حالة التأسيس</option>
                                            <?php $__currentLoopData = $furnishingStatuses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $status): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option value="<?php echo e($status->id); ?>"
                                                    <?php echo e(request('furnishing_status_id') == $status->id ? 'selected' : ''); ?>>
                                                    <?php echo e($status->name); ?></option>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </select>
                                    </div><!-- furnishing_status_id -->

                                    <div class="form-group mb-3 <?php echo e(request('price_max') == null ? 'd-none' : ''); ?>"
                                        data-field="price">
                                        <label class="d-flex justify-content-between align-items-center">
                                            <span>السعر</span>
                                            <button type="button" class="btn-close font-13 text-danger float-left"
                                                data-hide="price">
                                                <i class="fa-solid fa-xmark"></i>
                                                إلغاء
                                            </button>
                                        </label>
                                        <div class="d-flex gap-2">
                                            <input type="number" name="price_min" class="form-control ml-2"
                                                placeholder="أقل سعر" value="<?php echo e(request('price_min')); ?>">
                                            <input type="number" name="price_max" class="form-control" placeholder="أعلى سعر"
                                                value="<?php echo e(request('price_max')); ?>">
                                        </div>
                                    </div><!-- price -->


                                    <div class="form-group mb-3 <?php echo e(request('bathrooms') == null ? 'd-none' : ''); ?>"
                                        data-field="bathrooms">
                                        <label class="d-flex justify-content-between align-items-center">
                                            <span>عدد الحمامات</span>
                                            <button type="button" class="btn-close font-13 text-danger float-left"
                                                data-hide="bathrooms">
                                                <i class="fa-solid fa-xmark"></i>
                                                إلغاء
                                            </button>
                                        </label>
                                        <div class="d-flex gap-2">
                                            <input type="number" name="bathrooms" class="form-control text-center"
                                                value="<?php echo e(request('bathrooms')); ?>">
                                        </div>
                                    </div><!-- bathrooms -->

                                    <div class="form-group mb-3 <?php echo e(request('bedrooms') == null ? 'd-none' : ''); ?>"
                                        data-field="bedrooms">
                                        <label class="d-flex justify-content-between align-items-center">
                                            <span>عدد الغرف</span>
                                            <button type="button" class="btn-close font-13 text-danger float-left"
                                                data-hide="bedrooms">
                                                <i class="fa-solid fa-xmark"></i>
                                                إلغاء
                                            </button>
                                        </label>
                                        <div class="d-flex gap-2">
                                            <input type="number" name="bedrooms" class="form-control text-center"
                                                value="<?php echo e(request('bedrooms')); ?>">
                                        </div>
                                    </div><!-- bedrooms -->


                                </div><!-- search-fields -->


                                <button type="submit" class="btn btn-light border btn-block">تطبيق البحث</button>

                                <div class="my-2 font-weight-500">اختر بنود للبحث</div>
                                <?php $__currentLoopData = $search_keys; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $searchKey => $searchItem): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <button type="button" class="btn-choose-search-item btn btn-sm btn-second mb-2"
                                        data-show="<?php echo e($searchKey); ?>"><?php echo e($searchItem); ?></button>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </form>



                         <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal91e80a119f881aea9c6213b3256cb8b2f369ed09)): ?>
<?php $component = $__componentOriginal91e80a119f881aea9c6213b3256cb8b2f369ed09; ?>
<?php unset($__componentOriginal91e80a119f881aea9c6213b3256cb8b2f369ed09); ?>
<?php endif; ?>
                    </div>
                </div><!-- search -->
            <?php endif; ?>


            <div class="<?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('properties_allow_search')): ?><?php echo e('col-lg-9 col-md-12'); ?> <?php else: ?> <?php echo e('col-12'); ?> <?php endif; ?>">


                <div class="numbers">
                    <span class=" font-weight-500 d-inline-block mb-3 font-14">( <?php echo e($totalProperties); ?> ) إجمالي
                        النتائج</span>
                    <span class=" text-muted mx-2 font-14">|</span>
                    <span class=" font-weight-500 d-inline-block mb-3 font-14">( <?php echo e($count_all); ?> ) إجمالي
                        العقارات</span>
                </div><!-- numbers -->

                <?php if(count($properties) != 0): ?>
                    <div class="row justify-content-center">
                        <?php $__currentLoopData = $properties; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <div
                                class="parents <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('properties_allow_search')): ?><?php echo e('col-12'); ?> <?php else: ?> <?php echo e('col-xl-9 col-lg-12 col-md-12'); ?> <?php endif; ?>">
                                <div class="ca rd box p-0 mb-3">
                                    <div class="row no-gutters">
                                        <div class="col-md-4">

                                            <a href="<?php echo e(route('properties.show', $row->uuid)); ?>" target="_blank">
                                                <div class="propertie-image">
                                                    <img height="260px" width="100%"
                                                        class=" radius-br radius-tr object-cover"
                                                        src="<?php echo e(propertyImage($row->main_image)); ?>">

                                                    <?php if($row->units_count > 0): ?>
                                                        <div class="units-count-badge btn btn-main radius btn-sm">
                                                            <span class="font-weight-500">
                                                                ( <?php echo e($row->units_count); ?> )
                                                                عدد النماذج
                                                            </span>
                                                        </div>
                                                    <?php endif; ?>

                                                </div><!-- image -->
                                            </a>
                                        </div>
                                        <div class="col-md-8">
                                            <div class="card-body">


                                                <h5 class="card-title">
                                                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('properties_allow_copy_link')): ?>
                                                        <a href="<?php echo e(route('properties.show', $row->uuid)); ?>"
                                                            class=" text-black font-weight-600" target="_blank">
                                                            <?php echo e($row->title); ?>

                                                        </a>
                                                    <?php else: ?>
                                                        <?php echo e($row->title); ?>

                                                    <?php endif; ?>
                                                </h5>

                                                <h6 class=" font-18 text-success font-weight-500">
                                                    <span class="d-inline-block"><?php echo e(number_format($row->price)); ?></span>
                                                    <span class="currency-icon">
                                                        <?php echo currency_icon(); ?>

                                                    </span>
                                                </h6><!-- price -->

                                                <div class="prop d-flex flex-wrap mt-2">

                                                    <?php if($row->area): ?>
                                                        <div class="mb-2 ml-3">
                                                            <img width="16px" height="16px"
                                                                src="<?php echo e(asset('dashboard/images/icons/mtr.svg')); ?>"
                                                                alt="">
                                                            <span class="font-weight-500"><?php echo e($row->area); ?> <small
                                                                    class="">م</small></span>
                                                        </div>
                                                    <?php endif; ?> <!-- area -->

                                                    <?php if($row->bedrooms): ?>
                                                        <div class="mb-2 ml-3">
                                                            <img width="16px" height="16px"
                                                                src="<?php echo e(asset('dashboard/images/icons/room.svg')); ?>"
                                                                alt="">
                                                            <span class="font-weight-500"><?php echo e($row->bedrooms); ?></span>
                                                        </div>
                                                    <?php endif; ?> <!-- bedrooms -->

                                                    <?php if($row->bathrooms): ?>
                                                        <div class="mb-2 ml-3">
                                                            <img width="16px" height="16px"
                                                                src="<?php echo e(asset('dashboard/images/icons/bathroom.svg')); ?>"
                                                                alt="">
                                                            <span class="font-weight-500"><?php echo e($row->bathrooms); ?></span>
                                                        </div>
                                                    <?php endif; ?> <!-- bathrooms -->


                                                    <?php if($row?->neighborhood?->name): ?>
                                                        <div class="mb-2 ">
                                                            <img width="16px" height="16px"
                                                                src="<?php echo e(asset('dashboard/images/icons/map-pin-simple-area.svg')); ?>"
                                                                alt="">
                                                            <span
                                                                class="font-weight-500"><?php echo e($row->city?->name . ' — ' . $row->neighborhood?->name); ?></span>
                                                        </div>
                                                    <?php endif; ?> <!-- bathrooms -->

                                                </div><!-- prop -->

                                                <p class="card-text text-secondary mb-2">
                                                    <?php echo e(Str::limit($row->description, 200)); ?>

                                                </p><!-- description -->

                                                <p class="card-text">


                                                    <small class="tip" title="مضيف الإعلان">
                                                        <svg width="16" height="16" fill="#4d4d4d"
                                                            xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
                                                            <path
                                                                d="M406.5 399.6C387.4 352.9 341.5 320 288 320l-64 0c-53.5 0-99.4 32.9-118.5 79.6C69.9 362.2 48 311.7 48 256C48 141.1 141.1 48 256 48s208 93.1 208 208c0 55.7-21.9 106.2-57.5 143.6zm-40.1 32.7C334.4 452.4 296.6 464 256 464s-78.4-11.6-110.5-31.7c7.3-36.7 39.7-64.3 78.5-64.3l64 0c38.8 0 71.2 27.6 78.5 64.3zM256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-272a40 40 0 1 1 0-80 40 40 0 1 1 0 80zm-88-40a88 88 0 1 0 176 0 88 88 0 1 0 -176 0z" />
                                                        </svg>
                                                        <?php echo e(Str::limit($row->admin != null ? $row->admin->full_name : 'تم حذف المستخدم', 20)); ?>

                                                    </small>


                                                    <small title="<?php echo e($row->created_at); ?>" class="tip mx-2">
                                                        <svg xmlns="http://www.w3.org/2000/svg" width="16"
                                                            height="16" fill="#4d4d4d" viewBox="0 0 256 256">
                                                            <path
                                                                d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z">
                                                            </path>
                                                        </svg>
                                                        <?php echo e(parseTime($row->created_at)); ?>

                                                    </small>


                                                    <small class="tip" title="عدد المشاهدات">
                                                        <svg width="16" height="16" fill="#4d4d4d"
                                                            xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512">
                                                            <path
                                                                d="M288 80c-65.2 0-118.8 29.6-159.9 67.7C89.6 183.5 63 226 49.4 256c13.6 30 40.2 72.5 78.6 108.3C169.2 402.4 222.8 432 288 432s118.8-29.6 159.9-67.7C486.4 328.5 513 286 526.6 256c-13.6-30-40.2-72.5-78.6-108.3C406.8 109.6 353.2 80 288 80zM95.4 112.6C142.5 68.8 207.2 32 288 32s145.5 36.8 192.6 80.6c46.8 43.5 78.1 95.4 93 131.1c3.3 7.9 3.3 16.7 0 24.6c-14.9 35.7-46.2 87.7-93 131.1C433.5 443.2 368.8 480 288 480s-145.5-36.8-192.6-80.6C48.6 356 17.3 304 2.5 268.3c-3.3-7.9-3.3-16.7 0-24.6C17.3 208 48.6 156 95.4 112.6zM288 336c44.2 0 80-35.8 80-80s-35.8-80-80-80c-.7 0-1.3 0-2 0c1.3 5.1 2 10.5 2 16c0 35.3-28.7 64-64 64c-5.5 0-10.9-.7-16-2c0 .7 0 1.3 0 2c0 44.2 35.8 80 80 80zm0-208a128 128 0 1 1 0 256 128 128 0 1 1 0-256z" />
                                                        </svg>
                                                        <?php echo e($row->views_count); ?>

                                                    </small>
                                                </p><!-- date -->

                                                <div class="">



                                                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('properties_allow_copy_link')): ?>
                                                        <a class="btn btn-success btn-sm"
                                                            href="https://api.whatsapp.com/send?text=<?php echo e(route('properties.show', $row->uuid)); ?>"
                                                            target="_blank"><i class="fa-brands fa-whatsapp"></i> مشاركة</a>

                                                        <button title="نسخ الرابط"
                                                            data-link="<?php echo e(route('properties.show', $row->uuid)); ?>"
                                                            class="tip btn-copy-link btn btn-main btn-sm">
                                                            <i class="fa-solid fa-copy"></i>
                                                        </button>
                                                    <?php endif; ?>


                                                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('properties_edit')): ?>
                                                        <a title="تعديل" href="<?php echo e(route('properties.edit', $row->id)); ?>"
                                                            class="tip btn btn-soft-primary btn-sm">
                                                            <i class="fa-solid fa-pen-to-square"></i>
                                                        </a>
                                                    <?php endif; ?>


                                                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('properties_delete')): ?>
                                                        <form class="ajax-delete d-inline-block"
                                                            action="<?php echo e(route('properties.destroy')); ?>" method="POST">
                                                            <?php echo method_field('DELETE'); ?>
                                                            <?php echo csrf_field(); ?>
                                                            <input type="hidden" class="id" name="id"
                                                                value="<?php echo e($row->id); ?>">
                                                            <button type="submit"
                                                                data-delete="<?php echo e('هل انت متأكد من حذف ' . Str::limit($row->title, 50)); ?>"
                                                                class="btn btn-sm btn-soft-danger">
                                                                <i class="fa-solid fa-trash-can"></i>
                                                            </button>
                                                        </form>
                                                    <?php endif; ?>

                                                    


                                                </div>



                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </div>
                <?php else: ?>
                    <?php if(!empty($filters)): ?>
                        <div class="box text-center py-5">
                            <img width="128px" src="<?php echo e(asset('dashboard/images/empty-folder.png')); ?>" alt="">
                            <h4 class="text-center mb-0 mt-4">لا توجد نتائج للبحث</h4>
                        </div>
                    <?php else: ?>
                        <div class="box text-center py-5">
                            <img width="128px" src="<?php echo e(asset('dashboard/images/empty-folder.png')); ?>" alt="">
                            <h4 class="text-center mb-0 mt-4">لا يوجد عقارات في النظام</h4>
                        </div>
                    <?php endif; ?>
                <?php endif; ?>

                <div class="main-pageinate mb-5">
                    <?php echo $properties->onEachSide(1)->links(); ?>

                </div>

            </div><!-- col-md-9 -->

        </div><!-- row -->
    </section><!-- section -->




<?php $__env->stopSection(); ?>
<?php $__env->startSection('js'); ?>
    <script>
        $(document).ready(function() {

            $('.btn-copy-link').click(function(e) {

                let link = $(this).data('link');

                // إنشاء عنصر input مؤقت
                let tempInput = $("<input>");
                $("body").append(tempInput);
                tempInput.val(link).select();

                // تنفيذ النسخ
                document.execCommand("copy");

                // إزالة العنصر المؤقت
                tempInput.remove();

                // امسح أي toaster قديم واطبع الجديد
                toastr.clear();
                toastr.success("تم نسخ الرابط بنجاح");
            });





            $('.select2-field').select2({
                width: '100%',
                placeholder: 'اختر',
                //  allowClear: true,
                dir: 'rtl'
            });


            $('.btn-choose-search-item').click(function(e) {
                e.preventDefault();

                let btn = $(this),
                    field = btn.data('show'),
                    fieldDiv = $('[data-field="' + field + '"]');

                btn.attr('disabled', 'disabled');

                if (fieldDiv.hasClass('d-none')) {
                    fieldDiv.removeClass('d-none').hide().slideDown(150);
                }

            });


            $(".btn-close").click(function(e) {
                e.preventDefault();
                let btn = $(this);
                let $formGroup = btn.parents('.form-group');

                // إخفاء الحقل بطريقة سلسة ثم إضافة الصنف d-none
                $formGroup.slideUp(150, function() {
                    $formGroup.addClass('d-none');

                    // تفريغ القيم داخل الحقول المتنوعة
                    $formGroup.find('select').val(null).trigger(
                        'change'); // لإعادة تهيئة select2 مثلاً
                    $formGroup.find('input').val('');
                    $formGroup.find('textarea').val('');
                });

                // إعادة تفعيل زر العرض المرتبط بهذا الحقل
                $('[data-show="' + btn.data('hide') + '"]').removeAttr('disabled');
            });


            $('.btn-clear').click(function(e) {
                $($(this).data('field')).val('');
            });


            $(window).on("scroll", function() {
                let el = $(".sticky-top, .sticky-top-temp");

                if (el.length) {
                    console.log(el.height());

                    if (el.height() > 500) {
                        el.removeClass("sticky-top").addClass("sticky-top-temp");
                    } else {
                        el.removeClass("sticky-top-temp").addClass("sticky-top");
                    }
                }
            });



        });
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('dashboard.layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\internal-real-estate\resources\views/dashboard/properties/index.blade.php ENDPATH**/ ?>