<?php if($header->type == 'category'): ?>
<div class="white-box p-15">
    <h4 class="mb-10"><?php echo e(__('common.category_list')); ?></h4>
    <div id="categoryDiv" class="minh-250">
        <?php if(count(@$header->CateGorySectionItems())>0): ?>
        <?php $__currentLoopData = @$header->CateGorySectionItems(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <?php if($element->category->status == 1): ?>
        <div class="col-lg-12 single_item" data-id="<?php echo e($element->id); ?>" >
            <div class="mb-10">
                <div class="card" id="accordion_<?php echo e($element->id); ?>">
                    <div class="card-header card_header_element">
                        <p class="d-inline">
                            <?php echo e($element->title); ?>

                        </p>
                        <div class="pull-right">

                            <a href="javascript:void(0);" class=" d-inline  mr-10 primary-btn panel-title" data-toggle="collapse" data-target="#collapse_<?php echo e($element->id); ?>" aria-expanded="false" aria-controls="collapse_<?php echo e($element->id); ?>">Edit <span class="collapge_arrow"></span></a>
                            <a href="" data-id="<?php echo e($element->id); ?>" class=" d-inline primary-btn category_delete_btn"><i class="ti-close"></i></a>
                        </div>

                    </div>
                    <div id="collapse_<?php echo e($element->id); ?>" class="collapse" aria-labelledby="heading_<?php echo e($element->id); ?>" data-parent="#accordion_<?php echo e($element->id); ?>">
                        <div class="card-body">
                            <form enctype="multipart/form-data" id="element_edit_form">
                                <div class="row">
                                    <input type="hidden" name="id" value="<?php echo e($element->id); ?>">
                                    <input type="hidden" name="header_id" value="<?php echo e($header->id); ?>">
                                    <input type="hidden" id="header_type" value="<?php echo e($header->type); ?>">

                                    <div class="col-lg-12">
                                        <div class="primary_input mb-25">
                                            <label class="primary_input_label" for="title">
                                                <?php echo e(__('marketing.navigation_label')); ?> <span class="text-danger">*</span></label>
                                            <input class="primary_input_field title" type="text" name="title" autocomplete="off" value="<?php echo e($element->title); ?>"  placeholder="<?php echo e(__('marketing.navigation_label')); ?>" required>
                                        </div>
                                    </div>
                                    <?php if($header->type == 'category'): ?>
                                    <div class="col-lg-12">
                                        <div class="primary_input mb-25">
                                            <label class="primary_input_label" for=""><?php echo e(__('common.category_list')); ?></label>
                                            <select name="category" class="primary_select mb-15 category" required>

                                                <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <?php if($category->status == 1): ?>
                                                        <option value="<?php echo e($category->id); ?>" <?php echo e($element->category_id == $category->id?'selected':''); ?>><span>-></span> <?php echo e($category->name); ?></option>
                                                    <?php endif; ?>
                                                    <?php if(count($category->subCategories) > 0): ?>
                                                        <?php $__currentLoopData = $category->subCategories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $subItem): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                            <?php echo $__env->make('appearance::header.components._category_select_option',['subItem' => $subItem,'element' => $element], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                    <?php endif; ?>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                            </select>
                                            <span class="text-danger"></span>
                                        </div>
                                    </div>
                                    <?php endif; ?>
                                    <div class="col-xl-12">
                                        <div class="primary_input">
                                            <ul id="theme_nav" class="permission_list sms_list ">
                                                <li>
                                                    <label data-id="bg_option" class="primary_checkbox d-flex mr-12">
                                                        <input name="is_newtab" id="is_newtab" value="1" <?php echo e($element->is_newtab == 1? 'checked':''); ?> type="checkbox">
                                                        <span class="checkmark"></span>
                                                    </label>
                                                    <p><?php echo e(__('common.open_link_in_a_new_tab')); ?></p>
                                                </li>
                                            </ul>
                                        </div>
                                    </div>

                                    <div class="col-lg-12 text-center">
                                        <div class="d-flex justify-content-center pt_20">
                                            <button type="submit" class="primary-btn fix-gr-bg"><i
                                                    class="ti-check"></i>
                                                <?php echo e(__('common.update')); ?>

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

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

                </div>
            </div>
        </div>
        <?php endif; ?>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        <?php else: ?>
        <div class="mt-20 pt-100 text-center">
            <?php echo e(__('appearance.no_categories')); ?>

        </div>
        <?php endif; ?>
    </div>
</div>

<?php elseif($header->type == 'product'): ?>
<div class="white-box p-15">
    <h4 class="mb-10"><?php echo e(__('appearance.product_list')); ?></h4>
    <div id="productDiv" class="minh-250">
        <?php if(count(@$header->productSectionItems())>0): ?>
        <?php $__currentLoopData = @$header->productSectionItems(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <div class="col-lg-12 single_item" data-id="<?php echo e($element->id); ?>" >
            <div class="mb-10">
                <div class="card" id="accordion_<?php echo e($element->id); ?>">
                    <div class="card-header card_header_element">
                        <p class="d-inline">
                            <?php echo e($element->title); ?>

                        </p>
                        <div class="pull-right">

                            <a href="javascript:void(0);" class=" d-inline  mr-10 primary-btn panel-title" data-toggle="collapse" data-target="#collapse_<?php echo e($element->id); ?>" aria-expanded="false" aria-controls="collapse_<?php echo e($element->id); ?>"><?php echo e(__('common.edit')); ?> <span class="collapge_arrow"></span></a>
                            <a href="" data-id="<?php echo e($element->id); ?>" class="d-inline primary-btn product_delete_btn"><i class="ti-close"></i></a>
                        </div>

                    </div>
                    <div id="collapse_<?php echo e($element->id); ?>" class="collapse" aria-labelledby="heading_<?php echo e($element->id); ?>" data-parent="#accordion_<?php echo e($element->id); ?>">
                        <div class="card-body">
                            <form enctype="multipart/form-data" id="element_edit_form">
                                <div class="row">
                                    <input type="hidden" name="id" value="<?php echo e($element->id); ?>">
                                    <input type="hidden" name="header_id" value="<?php echo e($header->id); ?>">
                                    <input type="hidden" id="header_type" value="<?php echo e($header->type); ?>">

                                    <div class="col-lg-12">
                                        <div class="primary_input mb-25">
                                            <label class="primary_input_label" for="title">
                                                <?php echo e(__('marketing.navigation_label')); ?> <span class="text-danger">*</span></label>
                                            <input class="primary_input_field title" type="text" name="title" autocomplete="off" value="<?php echo e($element->title); ?>"  placeholder="<?php echo e(__('marketing.navigation_label')); ?>" required>
                                        </div>
                                    </div>
                                    <?php if($header->type == 'product'): ?>
                                    <div class="col-lg-12">
                                        <div class="primary_input mb-25">
                                            <label class="primary_input_label" for=""><?php echo e(__('appearance.product_list')); ?></label>
                                            <select name="product" class="primary_select mb-15 product" required>
                                                <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <option <?php echo e($element->product_id == $product->id?'selected':''); ?> value="<?php echo e($product->id); ?>"><?php echo e(@$product->product->product_name); ?> <?php if(isModuleActive('MultiVendor')): ?> [<?php if($product->seller->role->type == 'seller'): ?> <?php echo e($product->seller->first_name); ?> <?php else: ?> Inhouse <?php endif; ?>] <?php endif; ?></option>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                            </select>
                                            <span class="text-danger"></span>
                                        </div>
                                    </div>

                                    <?php endif; ?>
                                    <div class="col-xl-12">
                                        <div class="primary_input">
                                            <ul id="theme_nav" class="permission_list sms_list ">
                                                <li>
                                                    <label data-id="bg_option" class="primary_checkbox d-flex mr-12">
                                                        <input name="is_newtab" id="is_newtab" value="1" <?php echo e($element->is_newtab == 1? 'checked':''); ?> type="checkbox">
                                                        <span class="checkmark"></span>
                                                    </label>
                                                    <p><?php echo e(__('common.open_link_in_a_new_tab')); ?></p>
                                                </li>
                                            </ul>
                                        </div>
                                    </div>

                                    <div class="col-lg-12 text-center">
                                        <div class="d-flex justify-content-center pt_20">
                                            <button type="submit" class="primary-btn fix-gr-bg"><i
                                                    class="ti-check"></i>
                                                <?php echo e(__('common.update')); ?>

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

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

                </div>
            </div>
        </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        <?php else: ?>
        <div class="mt-20 pt-100 text-center">
            <?php echo e(__('appearance.no_categories')); ?>

        </div>
        <?php endif; ?>
    </div>
</div>

<?php elseif($header->type == 'slider'): ?>

    <div class="white-box p-15">
        <h4 class="mb-10"><?php echo e(__('appearance.slider_list')); ?></h4>
        <div id="sliderDiv" class="minh-250">
            <?php if(count(@$header->sliderSectionItems())>0): ?>
            <?php $__currentLoopData = @$header->sliderSectionItems(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <div class="col-lg-12 single_item" data-id="<?php echo e($element->id); ?>" >
                <div class="mb-10">
                    <div class="card" id="accordion_<?php echo e($element->id); ?>">
                        <div class="card-header card_header_element">
                            <p class="d-inline">
                                <?php echo e($element->name); ?>

                            </p>
                            <div class="pull-right">

                                <a href="javascript:void(0);" class=" d-inline  mr-10 primary-btn panel-title" data-toggle="collapse" data-target="#collapse_<?php echo e($element->id); ?>" aria-expanded="false" aria-controls="collapse_<?php echo e($element->id); ?>"><?php echo e(__('common.edit')); ?> <span class="collapge_arrow"></span></a>
                                <a href="" data-id="<?php echo e($element->id); ?>" class="d-inline primary-btn slider_delete_btn"><i class="ti-close"></i></a>
                            </div>

                        </div>
                        <div id="collapse_<?php echo e($element->id); ?>" class="collapse" aria-labelledby="heading_<?php echo e($element->id); ?>" data-parent="#accordion_<?php echo e($element->id); ?>">
                            <div class="card-body">
                                <form enctype="multipart/form-data" id="element_edit_form">
                                    <div class="row">
                                        <input type="hidden" name="id" value="<?php echo e($element->id); ?>">
                                        <input type="hidden" name="header_id" value="<?php echo e($header->id); ?>">
                                        <input type="hidden" id="header_type" value="<?php echo e($header->type); ?>">

                                        <div class="col-lg-12">
                                            <div class="primary_input mb-25">
                                                    <label class="primary_input_label"
                                                        for="name"><?php echo e(__('common.name')); ?> <span class="text-danger">*</span></label>
                                                        <input class="primary_input_field" type="text" id="name" name="name" autocomplete="off"
                                                    value="<?php echo e($element->name); ?>" placeholder="<?php echo e(__('common.name')); ?>" required>
                                            </div>
                                            <span class="text-danger" id="error_name"></span>
                                        </div>

                                        <div class="col-lg-8">
                                            <div class="primary_input mb-25">
                                                <label class="primary_input_label" for=""><?php echo e(__('appearance.slider_image')); ?> (660 x 365)PX <span class="text-danger">*</span></label>
                                                <div class="primary_file_uploader">
                                                    <input class="primary-input" type="text" id="banner_image_file_<?php echo e($element->id); ?>"
                                                        placeholder="<?php echo e(__('common.browse')); ?> <?php echo e(__('common.image')); ?>" readonly="">
                                                    <button class="" type="button">
                                                        <label class="primary-btn small fix-gr-bg"
                                                            for="slider_image_<?php echo e($element->id); ?>"><?php echo e(__('common.browse')); ?> </label>
                                                        <input type="file" class="d-none slider_image_edit" data-img_id="#slider_img_div_<?php echo e($element->id); ?>" data-name_id="#banner_image_file_<?php echo e($element->id); ?>" name="slider_image" id="slider_image_<?php echo e($element->id); ?>">
                                                    </button>
                                                </div>
                                            </div>
                                            <?php $__errorArgs = ['slider_image'];
$__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" id="error_slider_image"><?php echo e($message); ?></span>
                                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                        </div>
                                        <div class="col-lg-4">
                                            <div class="slider_img">

                                                <img class="sliderImgDiv" id="slider_img_div_<?php echo e($element->id); ?>"
                                                     src="<?php echo e(showImage($element->slider_image?$element->slider_image:'backend/img/default.png')); ?>" alt="">
                                            </div>
                                        </div>

                                        <div class="col-lg-12">
                                            <div class="primary_input mb-25">
                                                <label class="primary_input_label" for=""><?php echo e(__('appearance.slider_for')); ?></label>
                                                <select name="data_type" data-id="#data_div_<?php echo e($element->id); ?>" class="primary_select slider_drop mb-15 element_list_data_type">
                                                    <option value="">select</option>
                                                    <option <?php echo e($element->data_type == 'product'?'selected':''); ?> value="product"><?php echo e(__('appearance.for_product')); ?></option>
                                                    <option <?php echo e($element->data_type == 'category'?'selected':''); ?> value="category"><?php echo e(__('appearance.for_category')); ?></option>
                                                    <option <?php echo e($element->data_type == 'brand'?'selected':''); ?> value="brand"><?php echo e(__('appearance.for_brand')); ?></option>
                                                    <option <?php echo e($element->data_type == 'tag'?'selected':''); ?> value="tag"><?php echo e(__('appearance.for_tag')); ?></option>
                                                    <option <?php echo e($element->data_type == 'url'?'selected':''); ?> value="url"><?php echo e(__('appearance.for_url_not_support_in_mobile_app')); ?></option>
                                                </select>
                                                <span class="text-danger"></span>
                                            </div>
                                        </div>



                                        <div class="col-lg-12" id="data_div_<?php echo e($element->id); ?>">

                                                <?php if($element->data_type == 'url'): ?>

                                                    <div class="primary_input mb-25">
                                                            <label class="primary_input_label"
                                                                for="url"><?php echo e(__('setup.url')); ?> <span class="text-danger">*</span></label>
                                                                <input class="primary_input_field" type="text" id="url" name="url" autocomplete="off"
                                                            value="<?php echo e($element->url); ?>" placeholder="<?php echo e(__('setup.url')); ?>" required>
                                                    </div>
                                                    <span class="text-danger" id="error_name"></span>

                                                <?php elseif($element->data_type == 'product'): ?>

                                                    <div class="primary_input mb-25">
                                                        <label class="primary_input_label" for=""><?php echo e(__('product.product_list')); ?></label>
                                                        <select name="data_id" class="primary_select slider_drop mb-15">
                                                            <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                            <option <?php echo e($product->id == $element->data_id?'selected':''); ?> value="<?php echo e($product->id); ?>"><?php echo e($product->product->product_name); ?> <?php if(isModuleActive('MultiVendor')): ?> [<?php if($product->seller->role->type == 'seller'): ?> <?php echo e($product->seller->first_name); ?> <?php else: ?> Inhouse <?php endif; ?>] <?php endif; ?></option>
                                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                                        </select>
                                                        <span class="text-danger"></span>
                                                    </div>

                                                <?php elseif($element->data_type == 'category'): ?>

                                                    <div class="primary_input mb-25">
                                                        <label class="primary_input_label" for=""><?php echo e(__('product.category_list')); ?></label>
                                                        <select name="data_id" class="primary_select slider_drop mb-15">

                                                            <?php $__currentLoopData = $categories->where('parent_id', 0); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                            <option <?php echo e($item->id == $element->data_id?'selected':''); ?> value="<?php echo e($item->id); ?>"><span>-></span> <?php echo e($item->name); ?></option>

                                                            <?php if(count($item->subCategories) > 0): ?>
                                                                <?php $__currentLoopData = $item->subCategories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $subItem): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                                    <?php echo $__env->make('product::category.components.category_select_edit',['subItem' => $subItem, 'parent_id' => $element->data_id], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                            <?php endif; ?>
                                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                        </select>
                                                        <span class="text-danger"></span>
                                                    </div>

                                                <?php elseif($element->data_type == 'brand'): ?>

                                                    <div class="primary_input mb-25">
                                                        <label class="primary_input_label" for=""><?php echo e(__('product.brand_list')); ?></label>
                                                        <select name="data_id" id="slider_brand" class="primary_select slider_drop mb-15">
                                                            <?php $__currentLoopData = $brands; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $brand): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                            <option <?php echo e($brand->id == $element->data_id?'selected':''); ?>  value="<?php echo e($brand->id); ?>"><?php echo e($brand->name); ?></option>
                                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                                        </select>
                                                        <span class="text-danger"></span>
                                                    </div>

                                                <?php elseif($element->data_type == 'tag'): ?>

                                                    <div class="primary_input mb-25">
                                                        <label class="primary_input_label" for=""><?php echo e(__('common.tag')); ?> <?php echo e(__('common.list')); ?></label>
                                                        <select name="data_id" id="slider_tag" class="primary_select slider_drop mb-15">
                                                            <?php $__currentLoopData = $tags; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $tag): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                            <option <?php echo e($tag->id == $element->data_id?'selected':''); ?> value="<?php echo e($tag->id); ?>"><?php echo e($tag->name); ?></option>
                                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                                        </select>
                                                        <span class="text-danger"></span>
                                                    </div>


                                                <?php endif; ?>

                                        </div>



                                        <div class="col-lg-12">
                                            <div class="primary_input">
                                                <label class="primary_input_label" for=""><?php echo e(__('common.status')); ?></label>
                                                <ul id="theme_nav" class="permission_list sms_list ">
                                                    <li>
                                                        <label data-id="bg_option" class="primary_checkbox d-flex mr-12">
                                                            <input name="status" id="status_active" value="1" <?php echo e($element->status?'checked':''); ?> class="active"
                                                                type="radio">
                                                            <span class="checkmark"></span>
                                                        </label>
                                                        <p><?php echo e(__('common.active')); ?></p>
                                                    </li>
                                                    <li>
                                                        <label data-id="color_option" class="primary_checkbox d-flex mr-12">
                                                            <input name="status" value="0" id="status_inactive" <?php echo e($element->status == 0?'checked':''); ?> class="de_active" type="radio">
                                                            <span class="checkmark"></span>
                                                        </label>
                                                        <p><?php echo e(__('common.inactive')); ?></p>
                                                    </li>
                                                </ul>
                                                <span class="text-danger" id="status_error"></span>
                                            </div>
                                        </div>

                                        <div class="col-xl-12">
                                            <div class="primary_input">
                                                <ul id="theme_nav" class="permission_list sms_list ">
                                                    <li>
                                                        <label data-id="bg_option" class="primary_checkbox d-flex mr-12">
                                                            <input name="is_newtab" id="is_newtab" value="1" <?php echo e($element->is_newtab?'checked':''); ?> type="checkbox">
                                                            <span class="checkmark"></span>
                                                        </label>
                                                        <p><?php echo e(__('common.open_link_in_a_new_tab')); ?></p>
                                                    </li>
                                                </ul>
                                            </div>
                                        </div>

                                        <div class="col-lg-12 text-center">
                                            <div class="d-flex justify-content-center pt_20">
                                                <button type="submit" class="primary-btn fix-gr-bg"><i
                                                        class="ti-check"></i>
                                                    <?php echo e(__('common.update')); ?>

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

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

                    </div>
                </div>
            </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            <?php else: ?>


            <div class="mt-20 pt-100 text-center">
                <?php echo e(__('appearance.no_sliders')); ?>

            </div>
            <?php endif; ?>

        </div>
    </div>

<?php endif; ?>
<?php /**PATH /home/penastud/public_html/mart/Modules/Appearance/Resources/views/header/components/element_list.blade.php ENDPATH**/ ?>