"use strict";
! function (e) {
    new Lenis({
        autoRaf: !0
    });
    e(window).on("load", function () {
        var t = e("#preloader");
        t.length && t.hide(), e("body").css("overflow", "visible")
    });
    [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')).map(function (e) {
        return new bootstrap.Tooltip(e)
    });
    e("#tv-nav-monthly").length && function () {
        const t = {
                monthly: e("#tv-nav-monthly"),
                yearly: e("#tv-nav-yearly"),
                switcher: e("#tv-switcher-input"),
                tabMonthly: e("#tv-tab-monthly"),
                tabYearly: e("#tv-tab-yearly")
            },
            o = e => {
                t.switcher.prop("checked", e), t.monthly.toggleClass("is-active", e), t.yearly.toggleClass("is-active", !e), t.tabMonthly.toggleClass("tv-tab-hide", !e), t.tabYearly.toggleClass("tv-tab-hide", e)
            };
        [t.monthly, t.yearly].forEach(e => e.on("click", () => o(e.is(t.monthly)))), t.switcher.on("click", () => o(!t.monthly.hasClass("is-active")))
    }();
    var t, o = e(".offcanvas-nav-btn"),
        a = e(".navbar:not(.navbar-clone) .offcanvas-nav");

    function s(e) {
        const t = e.currentTarget,
            o = t.nextElementSibling;
        o.classList.contains("show") || t.closest(".dropdown-menu").querySelectorAll(".show").forEach(e => e.classList.remove("show")), o.classList.toggle("show");
        const a = t.closest("li.nav-item.dropdown.show");
        a && a.addEventListener("hidden.bs.dropdown", () => {
            document.querySelectorAll(".dropdown-submenu .show").forEach(e => e.classList.remove("show"))
        }), e.preventDefault(), e.stopPropagation()
    }
    a.length && (t = new bootstrap.Offcanvas(a[0], {
        scroll: !0
    }), o.on("click", function () {
        t && (t._isShown ? t.hide() : t.show())
    })), document.querySelectorAll(".dropdown-menu a.dropdown-toggle").forEach(e => {
        e.addEventListener("click", s)
    }), e(".btn").on("mouseenter", function (t) {
        var o = e(this).offset(),
            a = t.pageX - o.left,
            s = t.pageY - o.top;
        e(this).find("span").css({
            top: s,
            left: a
        })
    }).on("mouseout", function (t) {
        var o = e(this).offset(),
            a = t.pageX - o.left,
            s = t.pageY - o.top;
        e(this).find("span").css({
            top: s,
            left: a
        })
    }), e(window).on("scroll", function () {
        var t = e(".sticky-height"),
            o = e(".header-nav-wrapper");
        if (o.length) {
            var a = o.outerHeight(),
                s = e(".header-top"),
                n = (s.length ? s.outerHeight() : 0) + 200;
            e(window).scrollTop() > n ? (o.addClass("scroll-on"), t.length && t.css("height", a + "px")) : (o.removeClass("scroll-on"), t.length && t.css("height", "0"))
        }
    }), e(".canvas-menu .navbar .dropdown-toggle").append('<i class="fas fa-angle-down"></i>'), e(".canvas-menu .submenu").before('<i class="fas fa-angle-down switcher"></i>'), e(".vertical-menu li i.switcher").on("click", function () {
        var t = e(this).next(".submenu");
        t.slideToggle(300), t.parent().toggleClass("openmenu")
    }), e("button.burger-menu").on("click", function () {
        e(".canvas-menu").toggleClass("open"), e(".main-overlay").toggleClass("active")
    }), e(".canvas-menu .canvas-close, .main-overlay").on("click", function () {
        e(".canvas-menu").removeClass("open"), e(".main-overlay").removeClass("active")
    }), new PureCounter({
        decimals: 0
    }), e(document).ready(function () {
        jarallax(document.querySelectorAll(".jarallax"), {
            speed: .5
        })
    }), "undefined" != typeof Fancybox && Fancybox.bind && Fancybox.bind("[data-fancybox]", {
        Thumbs: {
            autoStart: !1
        },
        Toolbar: {
            display: ["close"]
        },
        animated: !0
    });
    document.querySelectorAll(".social-share .plus").forEach(e => {
        e.addEventListener("click", t => {
            t.preventDefault();
            const o = e.closest(".team-entry");
            document.querySelectorAll(".team-entry.active").forEach(e => {
                e !== o && e.classList.remove("active")
            }), o.classList.toggle("active")
        })
    }), e(".team-card .link-icon").on("click", function (t) {
        t.preventDefault();
        var o = e(this);
        o.closest(".team-card").find(".social-share").toggleClass("active"), o.toggleClass("icon-active")
    }), e(".faq-accordion .accordion-collapse").on("show.bs.collapse", function () {
        e(this).closest(".accordion-item").addClass("active")
    }), e(".faq-accordion .accordion-collapse").on("hide.bs.collapse", function () {
        e(this).closest(".accordion-item").removeClass("active")
    });
    new Swiper(".hero-slider", {
        slidesPerView: 1,
        autoplay: {
            delay: 4e3,
            disableOnInteraction: !1
        },
        loop: !0,
        spaceBetween: 0,
        effect: "creative",
        speed: 1500,
        creativeEffect: {
            prev: {
                scale: 1,
                opacity: 0,
                translate: [0, 0, 0]
            },
            next: {
                scale: 1.2,
                opacity: 0,
                translate: [0, 0, 0]
            }
        },
        navigation: {
            nextEl: ".swiper-button-next",
            prevEl: ".swiper-button-prev"
        }
    }), new Swiper(".hero-slider2", {
        autoplay: {
            delay: 4e3,
            disableOnInteraction: !1
        },
        loop: !0,
        spaceBetween: 0,
        effect: "creative",
        speed: 1500,
        creativeEffect: {
            prev: {
                scale: 1.1,
                opacity: 0,
                translate: [0, 0, 0]
            },
            next: {
                scale: 1.3,
                opacity: 0,
                translate: [0, 0, 0]
            }
        },
        navigation: {
            nextEl: ".swiper-button-next",
            prevEl: ".swiper-button-prev"
        },
        on: {
            slideChangeTransitionStart: function () {
                gsap.set(".slide-content > *", {
                    opacity: 0,
                    y: 30
                }), gsap.set(".hero-slider2 .abs-img", {
                    opacity: 0,
                    y: 30
                })
            },
            slideChangeTransitionEnd: function () {
                const e = document.querySelector(".swiper-slide-active");
                e && (gsap.to(e.querySelectorAll(".slide-content > *"), {
                    opacity: 1,
                    y: 0,
                    duration: .8,
                    stagger: .15,
                    ease: "power3.out"
                }), gsap.to(e.querySelectorAll(".hero-slider2 .abs-img"), {
                    opacity: 1,
                    y: 0,
                    duration: .8,
                    stagger: .15,
                    ease: "power3.out"
                }))
            }
        }
    }), new Swiper(".service-slider2", {
        slidesPerView: "auto",
        loop: !0,
        speed: 600,
        autoplay: !0,
        spaceBetween: 30,
        navigation: {
            nextEl: ".swiper-button-next",
            prevEl: ".swiper-button-prev"
        }
    });
    e(".marque-active").length && e(".marque-active").marquee({
        gap: 48,
        speed: 80,
        delayBeforeStart: 0,
        direction: "left",
        duplicated: !0,
        pauseOnHover: !0,
        startVisible: !0
    });
    new Swiper(".services-carousel", {
        loop: !0,
        spaceBetween: 30,
        speed: 600,
        autoplay: !0,
        pagination: {
            el: ".ct-pagination .swiper-pagination",
            clickable: !0
        },
        navigation: {
            nextEl: ".swiper-button-next",
            prevEl: ".swiper-button-prev"
        },
        breakpoints: {
            0: {
                slidesPerView: 1
            },
            768: {
                slidesPerView: 2
            },
            992: {
                slidesPerView: 3
            },
            1400: {
                slidesPerView: "auto"
            }
        }
    }), new Swiper(".video-slider", {
        loop: !0,
        speed: 600,
        effect: "fade",
        spaceBetween: 0,
        autoplay: {
            delay: 6e3,
            disableOnInteraction: !1
        }
    }), new Swiper(".brands-carousel", {
        loop: !0,
        autoplay: !0,
        speed: 600,
        spaceBetween: 30,
        breakpoints: {
            0: {
                slidesPerView: 1
            },
            768: {
                slidesPerView: 4
            },
            992: {
                slidesPerView: 6
            }
        }
    }), new Swiper(".work-carousel", {
        loop: !0,
        autoplay: !0,
        speed: 1e3,
        slidesPerView: "auto",
        centerSlides: !0,
        autoplay: {
            delay: 2500,
            disableOnInteraction: !1
        },
        spaceBetween: 30
    }), new Swiper(".brands-carousel2", {
        loop: !0,
        spaceBetween: 0,
        slidesPerView: 5,
        autoplay: {
            delay: 2500,
            disableOnInteraction: !1
        },
        freeMode: !0,
        freeModeMomentum: !1,
        grabCursor: !0,
        breakpoints: {
            0: {
                slidesPerView: 2
            },
            768: {
                slidesPerView: 4
            },
            992: {
                slidesPerView: 5
            }
        }
    }), new Swiper(".portfolio-carousel", {
        loop: !0,
        autoplay: !0,
        speed: 800,
        spaceBetween: 30,
        navigation: {
            nextEl: ".swiper-button-next",
            prevEl: ".swiper-button-prev"
        },
        breakpoints: {
            0: {
                slidesPerView: 1
            },
            768: {
                slidesPerView: 2
            },
            992: {
                slidesPerView: 3
            },
            1400: {
                slidesPerView: 4
            }
        }
    }), new Swiper(".review-slider", {
        loop: !0,
        autoplay: !0,
        speed: 800,
        slidesPerView: 1,
        navigation: {
            nextEl: ".swiper-button-next",
            prevEl: ".swiper-button-prev"
        },
        pagination: {
            el: ".swiper-pagination",
            clickable: !0
        }
    }), new Swiper(".review3-carousel", {
        loop: !0,
        autoplay: !0,
        speed: 800,
        spaceBetween: 30,
        navigation: {
            nextEl: ".swiper-button-next",
            prevEl: ".swiper-button-prev"
        },
        breakpoints: {
            0: {
                slidesPerView: 1
            },
            768: {
                slidesPerView: 2
            },
            992: {
                slidesPerView: 3
            }
        }
    });
    var n = new Swiper(".product-thumb", {
        spaceBetween: 10,
        slidesPerView: 4,
        freeMode: !0,
        watchSlidesProgress: !0,
        navigation: {
            nextEl: ".swiper-button-next",
            prevEl: ".swiper-button-prev"
        },
        breakpoints: {
            320: {
                direction: "horizontal",
                slidesPerView: 3
            },
            576: {
                direction: "vertical",
                slidesPerView: 4
            }
        }
    });
    new Swiper(".coverItem", {
        spaceBetween: 10,
        thumbs: {
            swiper: n
        }
    });
    e(".quantity").on("click", ".plus, .minus", function () {
        const t = e(this),
            o = t.closest(".quantity").find(".qty");
        let a = parseFloat(o.val()),
            s = parseFloat(o.attr("max")),
            n = parseFloat(o.attr("min")),
            i = o.attr("step");
        a && !isNaN(a) || (a = 1), s && !isNaN(s) || (s = ""), n && !isNaN(n) || (n = 1), i = "any" === i || "" === i || void 0 === i || isNaN(parseFloat(i)) ? 1 : parseFloat(i);
        const r = (i.toString().split(".")[1] || "").length;
        t.hasClass("plus") ? s && a >= s ? o.val(s) : o.val((a + i).toFixed(r)) : a <= n ? o.val(n) : o.val((a - i).toFixed(r)), o.trigger("change")
    }), e(".tv-select").niceSelect(), e(document).ready(function () {
        ! function () {
            const t = e(".scroll-top"),
                o = e(".scroll-top path");
            if (t.length && o.length) {
                const a = o[0],
                    s = a.getTotalLength();
                o.css({
                    transition: "none",
                    "stroke-dasharray": `${s} ${s}`,
                    "stroke-dashoffset": s
                }), a.getBoundingClientRect(), o.css("transition", "stroke-dashoffset 10ms linear");
                const n = function () {
                    const t = e(window).scrollTop(),
                        a = e(document).height() - e(window).height(),
                        n = s - t * s / a;
                    o.css("stroke-dashoffset", n)
                };
                n(), e(window).on("scroll", n);
                const i = 50;
                e(window).on("scroll", function () {
                    e(window).scrollTop() > i ? t.addClass("show") : t.removeClass("show")
                }), t.on("click", function (t) {
                    t.preventDefault(), e("html, body").animate({
                        scrollTop: 0
                    }, 600, "swing")
                })
            }
        }()
    }), e(window).on("load", function () {
        var t = e("#gallery-container");
        t.isotope({
            itemSelector: ".grid-item",
            percentPosition: !0,
            masonry: {
                columnWidth: ".grid-sizer"
            }
        }), e(".portfolio-menu .nav-link").on("click", function (o) {
            o.preventDefault();
            var a = e(this).attr("data-filter");
            t.isotope({
                filter: a
            }), e(".portfolio-menu .nav-link").removeClass("active"), e(this).addClass("active")
        })
    });
    let i = document.querySelectorAll(".sec-title");
    if (i.length) {
        let e = .03,
            t = 20,
            o = .1,
            a = "power2.out";
        i.forEach(s => {
            let n = new SplitText(s, {
                type: "chars, words"
            });
            gsap.from(n.chars, {
                duration: 1,
                delay: o,
                x: t,
                autoAlpha: 0,
                stagger: e,
                ease: a,
                scrollTrigger: {
                    trigger: s,
                    start: "top 85%"
                }
            })
        })
    }
    e(".fadeInUp").length > 0 && gsap.utils.toArray(".fadeInUp").forEach(e => {
        let t = e.getAttribute("data-fade-offset") || 40,
            o = e.getAttribute("data-duration") || .75,
            a = e.getAttribute("data-fade-from") || "bottom",
            s = e.getAttribute("data-on-scroll") || 1,
            n = e.getAttribute("data-delay") || .15,
            i = {
                opacity: 0,
                ease: e.getAttribute("data-ease") || "power2.out",
                duration: o,
                delay: n,
                x: "left" == a ? -t : "right" == a ? t : 0,
                y: "top" == a ? -t : "bottom" == a ? t : 0
            };
        1 == s && (i.scrollTrigger = {
            trigger: e,
            start: "top 85%"
        }), gsap.from(e, i)
    }), e("#ship_time").timepicker({
        timeFormat: "h:mm p",
        interval: 60
    }), e("#ship_date").datepicker({
        format: "mm-dd-yyyy"
    });
    e(".progress-circle-item").each(function () {
        const t = e(this),
            o = t.find(".number"),
            a = t.find(".progress-stroke"),
            s = parseFloat(o.attr("data-target"));
        e({
            Counter: 0
        }).animate({
            Counter: s
        }, {
            duration: 1500,
            easing: "swing",
            step: function () {
                o.text(Math.ceil(this.Counter) + "%");
                let e = 188.5 - this.Counter / 100 * 188.5;
                a.css("stroke-dashoffset", e)
            }
        })
    })
    $(document).ready(function () {
        function dynamicCurrentMenuClass(selector) {
            let currentPath = window.location.pathname;

            // Check all <a> inside menu
            selector.find("a").each(function () {
                let linkPath = $(this).attr("href");

                // Ignore empty or '#'
                if (!linkPath || linkPath === "#") return;

                // Normalize URL
                try {
                    let url = new URL(linkPath, window.location.origin);
                    linkPath = url.pathname;
                } catch (e) {
                    return;
                }

                // Match path
                if (linkPath === currentPath || linkPath === currentPath + "/") {
                    // Add .current to the closest li and parent dropdown li
                    $(this).closest("li").addClass("current");
                    $(this).closest("li").parents("li.dropdown").addClass("current");
                }

                // Special case: home
                if ((currentPath === "/" || currentPath === "") && linkPath === "/") {
                    $(this).closest("li").addClass("current");
                }
            });
        }

        if ($(".navbar-nav").length) {
            dynamicCurrentMenuClass($(".navbar-nav"));
        }
    });
}(jQuery);
//# sourceMappingURL=custom.js.map