var $j = jQuery.noConflict();


function StickyHeader() {

    var e = $j(".sticky-header-yes"),

        s = $j(".sticky-header-yes .elementor-container"),

        t = $j(".elementor-edit-mode .sticky-header-yes"),

        i = $j(".sticky-header-yes .elementor-container img"),

        o = e?.data("settings");



    if (void 0 !== o) {

        var a = o?.epress_transparent,

            r = $j(window).width(),

            n = e.height(),

            d = i.width();

        i.height();

    }

    if (void 0 !== r && r)

        if (r >= 1025) var l = "desktop";

        else if (r > 767 && r < 1025) l = "tablet";

        else if (r <= 767) l = "mobile";



    if ((console.log($j.inArray(l, a)), "-1" == $j.inArray(l, a))) {

        var h = o?.epress_scroll_distance,

            c = o?.epress_transparent_header_show,

            m = o?.epress_background,

            _b = o?.epress_custom_bottom_border_color,

            g = o?.epress_custom_bottom_border_width,

            b = o?.epress_shrink_header,

            y = o?.epress_custom_height_header,

            p = o?.custom_height_header_tablet,

            u = o?.custom_height_header_mobile,

            f = o?.shrink_header_logo,

            k = o?.custom_height_header_logo,

            v = o?.custom_height_header_logo_tablet,

            w = o?.custom_height_header_logo_mobile;



        console.log("o.epress_shrink_header", o?.epress_custom_height_header)

        if (void 0 !== y && y)

            if (r >= 1025) var z = y?.size;

            else if (r > 767 && r < 1025) {

                "" == (z = p?.size) && (z = y?.size);

            } else if (r <= 767) {

                "" == (z = u?.size) && (z = y?.size);

            }

        if (void 0 !== k && k)

            if (r >= 1025) {

                "" == (j = k?.size) && (j = z);

                r = d * (parseInt(j) / parseInt(n));

            } else if (r > 767 && r < 1025) {

                "" == (j = v?.size) && "" == (j = k?.size) && (j = z);

                r = d * (parseInt(j) / parseInt(n));

            } else if (r <= 767) {

                var j;

                "" == (j = w?.size) && "" == (j = k?.size) && (j = z);

                r = d * (parseInt(j) / parseInt(n));

            }



        if (g != undefined) {

            var $ = g?.size + "px" + " solid " + _b;

        }



        $j(window).scroll(function () {

            var o = $j(window).scrollTop();

            t && t.css("position", "relative"),

                o >= h?.size

                    ? (e.removeClass("header").addClass("sticky-header"),

                        e.removeClass("sticky-header-transparent-yes"),

                        e.css("background-color", m),

                        e.css("border-bottom", $),

                    "yes" == b &&

                    (e.css({

                        "padding-top": "0",

                        "padding-bottom": "0",

                        "margin-top": "0",

                        "margin-bottom": "0",

                    }),

                        s.css({

                            "min-height": z,

                            transition: "all 0.4s ease-in-out",

                            "-webkit-transition": "all 0.4s ease-in-out",

                            "-moz-transition": "all 0.4s ease-in-out",

                        })),

                    "yes" == f &&

                    i.css({

                        width: r,

                        transition: "all 0.4s ease-in-out",

                        "-webkit-transition": "all 0.4s ease-in-out",

                        "-moz-transition": "all 0.4s ease-in-out",

                    }))

                    : (e.removeClass("sticky-header").addClass("header"),

                        e.css("background-color", ""),

                        e.css("border-bottom", ""),

                        "yes" == c

                            ? e.addClass("sticky-header-transparent-yes")

                            : e.removeClass("sticky-header-transparent-yes"),

                    "yes" == b &&

                    (e.css({

                        "padding-top": "",

                        "padding-bottom": "",

                        "margin-top": "",

                        "margin-bottom": "",

                    }),

                        s.css("min-height", "")),

                    "yes" == f && i.css({height: "", width: ""})),

                s.css({

                    "min-height": z,

                    transition: "all 0.4s ease-in-out",

                    "-webkit-transition": "all 0.4s ease-in-out",

                    "-moz-transition": "all 0.4s ease-in-out",

                });

        });

    }

}



$j(window).on("load", function () {

    "use strict";

    StickyHeader();

});

