    <!-- jquery -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"
        integrity="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g=="
        crossorigin="anonymous" referrerpolicy="no-referrer"></script>
    <!-- jquery -->

    <!-- swiperjs -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/Swiper/5.4.5/js/swiper.min.js"
        integrity="sha512-VHsNaV1C4XbgKSc2O0rZDmkUOhMKPg/rIi8abX9qTaVDzVJnrDGHFnLnCnuPmZ3cNi1nQJm+fzJtBbZU9yRCww=="
        crossorigin="anonymous"></script>
    <script src="<?php echo e(asset('assets/js/swiper.js')); ?>"></script>
    <!-- swiperjs -->

    <!-- bootstrap -->
    <script src="<?php echo e(asset('assets/js/bootstrap.bundle.min.js')); ?>"></script>
    <!-- bootstrap -->

    <!-- owl-carousel -->
    <script src="<?php echo e(asset('assets/js/owl.carousel.min.js')); ?>"></script>
    <!-- owl-carousel -->
    <!-- sweetalert2 CSS File -->
    <script src="<?php echo e(asset('assets/sweetalert/sweetalert2.all.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/sweetalert/sweetalert2.all.min.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/sweetalert/sweetalert2.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/sweetalert/sweetalert2.min.js')); ?>"></script>

    <!-- jQuery UI -->
    
    <script src="<?php echo e(asset('assets/js/jquery-ui.min.js')); ?>"></script>
    <!-- jQuery UI -->

    <!-- customjs -->
    <script src="<?php echo e(asset('assets/js/cart.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/js/script.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/js/custom.js')); ?>"></script>
    <!-- customjs -->

    <script>
        $(document).ready(function() {
            $.ajaxSetup({
                headers: {
                    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                }
            });
        });
    </script>


    <script>
        var cart = new Cart();
        $(document).ready(function() {
            $(".cartTotal").html(cart.totalItems());

            $(document).on("click", ".product-size a", function(event) {
                event.preventDefault();

                var selectedProductSize = $(this).data("product-size");
                console.log(selectedProductSize);
                $(".selected-size").text(selectedProductSize);
                $(".product_size").text(selectedProductSize);
            });

            $(".getcartitem").click(function(event) {
                event.preventDefault();

                let productSize = $(".selected-size").text().trim();
                let hasSize = $("#hasSize").val() === "true";

                if (hasSize && (productSize === "" || productSize === "Please Select Size")) {
                    $(".selected-size").text("Please Select Size").css("color", "red");
                    return;
                }

                var productId = $(this).data("product-id");
                let psize = hasSize ? productSize : null; 
                let id = null;
                let name = '';
                let price = '';
                let quantity = 1;
                let image = '';

                $.getJSON("<?php echo e(url('cart')); ?>/" + productId, function(data) {
                    id = data.id;
                    name = data.name;
                    price = data.price;
                    code = data.product_code;
                    p_discount = data.discount_price;
                    thumbnail = data.thumbnail;

                    let product = {
                        'id': id,
                        'name': name,
                        'price': price,
                        'quantity': quantity,
                        'productCode': code,
                        'thumbnail': thumbnail,
                        'discount': p_discount,
                        'size': psize
                    };

                    cart.addItem(product);
                    $(".cartTotal").html(cart.totalItems());

                    $("#staticcart").modal("show");
                });
            });


            $("#searchright, #searchexpand").autocomplete({
                source: "<?php echo e(url('searchbox')); ?>",
                minLength: 1,
                select: function(event, ui) {
                    // console.log(ui);

                    if (ui.item.slug) {
                        window.location.href = "/details/" + ui.item.slug;
                    }
                }

            });

        });
    </script>
<?php /**PATH /home/brainbo1/sefcard.com/resources/views/frontend/layouts/script.blade.php ENDPATH**/ ?>