CasperSecurity
var W3Crm = function () {
"use strict";
var t = $(window).width();
$(window).height();
var e = function () {
jQuery("select.nice-select").length > 0 && (jQuery("select.nice-select").niceSelect(), document.querySelectorAll("select.nice-select").forEach((t, e) => {
var a = [];
jQuery(t).parents().map((e, n) => {
("hidden" === jQuery(jQuery(t).parents()[e]).css("overflow-x") || "auto" === jQuery(jQuery(t).parents()[e]).css("overflow-x") || "auto" === jQuery(jQuery(t).parents()[e]).css("overflow") || "hidden" === jQuery(jQuery(t).parents()[e]).css("overflow") || "hidden" === jQuery(jQuery(t).parents()[e]).css("overflow-y") || "auto" === jQuery(jQuery(t).parents()[e]).css("overflow-y")) && a.push(jQuery(t).parents()[e])
}), jQuery(a[0]).height() < jQuery(t).offset().top - jQuery(a[0]).offset()?.top + jQuery(t).next().height() + 10 + jQuery(t).next().find("ul.list").height() && jQuery(t).addClass("dropUp")
}), $(".status-select").on("change", function () {
$(this).removeClass("status-complete status-pending status-testing status-progress status-high status-low status-medium");
var t = $(this).val();
"pending" === t ? $(this).addClass("status-pending") : "complete" === t ? $(this).addClass("status-complete") : "testing" === t ? $(this).addClass("status-testing") : "progress" === t ? $(this).addClass("status-progress") : "medium" === t ? $(this).addClass("status-medium") : "high" === t ? $(this).addClass("status-high") : "low" === t && $(this).addClass("status-low"), $(this).niceSelect("update")
}))
}, a = function () {
jQuery(".calendar-container").length > 0 && $(".calendar-container").calendar({
prevButton: '<i class="fa-solid fa-angle-left"></i>',
nextButton: '<i class="fa-solid fa-angle-right"></i>'
})
}, n = function () {
setTimeout(function () {
jQuery("#preloader").remove(), $("#main-wrapper").addClass("show")
}, 800)
}, s = function () {
jQuery("#menu").length > 0 && $("#menu").metisMenu(), jQuery(".metismenu > .mm-active ").each(function () {
!jQuery(this).children("ul").length > 0 && jQuery(this).addClass("active-no-child")
})
}, i = function () {
function t(t, e) {
if (!t || !t.tagName) return "";
var a, n, s = document.createElement("div");
return s.appendChild(t.cloneNode(!1)), a = s.innerHTML, e && (n = a.indexOf(">") + 1, a = a.substring(0, n) + t.innerHTML + a.substring(n)), s = null, a
}
$(".svg-btn").on("click", function () {
var t = $(this).closest(".svg-icons-ov").find(".svg-classname").text();
$("#svg_img_Brassieresvg").find(".modal-title").text(t), $(".iconValue").text('<img src="images/iconly/light/' + t + '"/>')
}), $(".img-btn").on("click", function () {
var t = $(this).closest(".svg-icons-ov").find(".svg-classname").text();
$("#svg_img_Brassieresvg").find(".modal-title").text(t);
var e, a, n,
s = (e = $(this).closest(".svg-icons-ov").find(".svg-icons-prev")[0].innerHTML, a = document.createTextNode(e), (n = document.createElement("div")).appendChild(a), n.innerHTML);
$(".iconValue").html(s)
})
}, o = function () {
$("#checkAll").on("change", function () {
$("td input, .email-list .custom-checkbox input").prop("checked", $(this).prop("checked"))
}), $(".checkAll").on("click", function () {
jQuery(this).closest(".ItemsCheckboxSec").find('input[type="checkbox"]').prop("checked", $(this).prop("checked"))
}), $(".checkAllInput").on("click", function () {
jQuery(this).closest(".ItemsCheckboxSec").find('input[type="checkbox"]').prop("checked", !0)
}), $(".unCheckAllInput").on("click", function () {
jQuery(this).closest(".ItemsCheckboxSec").find('input[type="checkbox"]').prop("checked", !1)
})
}, c = function () {
$(".nav-control").on("click", function () {
$("#main-wrapper").toggleClass("menu-toggle"), $(".hamburger").toggleClass("is-active"), r()
})
}, l = function () {
for (var t = window.location, e = $("ul#menu a").filter(function () {
return this.href == t
}).addClass("mm-active").parent().addClass("mm-active"); e.is("li");) e = e.parent().addClass("mm-show").parent().addClass("mm-active")
}, d = function () {
$("ul#menu>li").on("click", function () {
let t = $("body").attr("data-sidebar-style");
"mini" === t && (console.log($(this).find("ul")), $(this).find("ul").stop())
})
}, r = function () {
var t = window.innerHeight, t = window.innerHeight;
(t > 0 ? t : screen.height) && ($(".content-body").css("min-height", window.innerHeight - 70 + "px"), setTimeout(() => {
"vertical" === $("body").attr("data-layout") && ("mini" === $("body").attr("data-sidebar-style") && $(".deznav .metismenu").height() > window.innerHeight - 60 || "modern" === $("body").attr("data-sidebar-style") && $(".deznav .metismenu").height() > window.innerHeight - 60 || "full" === $("body").attr("data-sidebar-style") && $("#main-wrapper").hasClass("menu-toggle") && $(".deznav .metismenu").height() > window.innerHeight - 60) && $(".content-body").css("min-height", $(".deznav .metismenu").height() + 110 + "px")
}, 500)), setTimeout(() => {
"fixed" === $("body").attr("data-header-position") && "horizontal" === $("body").attr("data-layout") && "fixed" === $("body").attr("data-sidebar-position") ? $(".content-body").css("padding-top", $(".deznav").height() + $(".header").height() + "px") : "fixed" === $("body").attr("data-header-position") && "horizontal" === $("body").attr("data-layout") && "static" === $("body").attr("data-sidebar-position") ? $(".content-body").css("padding-top", $(".header").height() + "px") : "static" === $("body").attr("data-header-position") && "horizontal" === $("body").attr("data-layout") && "fixed" === $("body").attr("data-sidebar-position") ? $(".content-body").css("padding-top", "0px") : $(".content-body").css("padding-top", "")
}, 400)
}, h = function () {
$('a[data-action="collapse"]').on("click", function (t) {
t.preventDefault(), $(this).closest(".card").find('[data-action="collapse"] i').toggleClass("mdi-arrow-down mdi-arrow-up"), $(this).closest(".card").children(".card-body").collapse("toggle")
}), $('a[data-action="expand"]').on("click", function (t) {
t.preventDefault(), $(this).closest(".card").find('[data-action="expand"] i').toggleClass("icon-size-actual icon-size-fullscreen"), $(this).closest(".card").toggleClass("card-fullscreen")
}), $('[data-action="close"]').on("click", function () {
$(this).closest(".card").removeClass().slideUp("fast")
}), $('[data-action="reload"]').on("click", function () {
var t = $(this);
t.parents(".card").addClass("card-load"), t.parents(".card").append('<div class="card-loader"><i class=" ti-reload rotate-refresh"></div>'), setTimeout(function () {
t.parents(".card").children(".card-loader").remove(), t.parents(".card").removeClass("card-load")
}, 2e3)
})
}, u = function () {
let t = $(".header").innerHeight();
$(window).scroll(function () {
"horizontal" === $("body").attr("data-layout") && "static" === $("body").attr("data-header-position") && "fixed" === $("body").attr("data-sidebar-position") && ($(this.window).scrollTop() >= t ? $(".deznav").addClass("fixed") : $(".deznav").removeClass("fixed"))
})
}, f = function () {
t <= 991 && (jQuery(".menu-tabs .nav-link").on("click", function () {
jQuery(this).hasClass("open") ? (jQuery(this).removeClass("open"), jQuery(".fixed-content-box").removeClass("active"), jQuery(".hamburger").show()) : (jQuery(".menu-tabs .nav-link").removeClass("open"), jQuery(this).addClass("open"), jQuery(".fixed-content-box").addClass("active"), jQuery(".hamburger").hide())
}), jQuery(".close-fixed-content").on("click", function () {
jQuery(".fixed-content-box").removeClass("active"), jQuery(".hamburger").removeClass("is-active"), jQuery("#main-wrapper").removeClass("menu-toggle"), jQuery(".hamburger").show()
}))
}, m = function () {
jQuery(window).on("scroll", function () {
jQuery(".header").length > 0 && (jQuery(".header"), $(window).scroll(function () {
var t = $(".header");
$(window).scrollTop() >= 100 ? t.addClass("is-fixed") : t.removeClass("is-fixed")
}))
})
}, p = function () {
jQuery(".bell-link").on("click", function () {
jQuery(".chatbox").addClass("active")
}), jQuery(".chatbox-close").on("click", function () {
jQuery(".chatbox").removeClass("active")
})
}, v = function () {
jQuery(".deznav-scroll").length
}, g = function () {
$(".btn-number").on("click", function (t) {
t.preventDefault(), fieldName = $(this).attr("data-field"), type = $(this).attr("data-type");
var e = $("input[name='" + fieldName + "']"), a = parseInt(e.val());
isNaN(a) ? e.val(0) : "minus" == type ? e.val(a - 1) : "plus" == type && e.val(a + 1)
})
}, b = function () {
jQuery(".dz-chat-user-box .dz-chat-user").on("click", function () {
jQuery(".dz-chat-user-box").addClass("hidden"), jQuery(".dz-chat-history-box").removeClass("hidden")
}), jQuery(".dz-chat-history-back").on("click", function () {
jQuery(".dz-chat-user-box").removeClass("hidden"), jQuery(".dz-chat-history-box").addClass("hidden")
}), jQuery(".dz-fullscreen").on("click", function () {
jQuery(".dz-fullscreen").toggleClass("active")
})
}, C = function () {
jQuery(".dz-fullscreen").on("click", function (t) {
document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement ? document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen() : document.documentElement.requestFullscreen ? document.documentElement.requestFullscreen() : document.documentElement.webkitRequestFullscreen ? document.documentElement.webkitRequestFullscreen() : document.documentElement.mozRequestFullScreen ? document.documentElement.mozRequestFullScreen() : document.documentElement.msRequestFullscreen && document.documentElement.msRequestFullscreen()
})
}, k = function () {
jQuery(".show-pass").on("click", function () {
jQuery(this).toggleClass("active"), "password" == jQuery("#dz-password").attr("type") ? jQuery("#dz-password").attr("type", "text") : "text" == jQuery("#dz-password").attr("type") && jQuery("#dz-password").attr("type", "password")
})
jQuery(".show-confirm-pass").on("click", function () {
jQuery(this).toggleClass("active"), "password" == jQuery("#dz-confirm-password").attr("type") ? jQuery("#dz-confirm-password").attr("type", "text") : "text" == jQuery("#dz-confirm-password").attr("type") && jQuery("#dz-confirm-password").attr("type", "password")
})
}, y = function () {
$(".heart").on("click", function () {
$(this).toggleClass("heart-blast")
})
}, z = function () {
$(".remove-btn").on("click", function () {
$(this).parent().remove()
})
}, x = function () {
var t = $(".img-select").find("option:selected").css("background-image");
$(".img-select").find(".current").css("background-image", t)
}, w = function () {
$(".dz-load-more").on("click", function (t) {
t.preventDefault(), $(this).append(' <i class="fas fa-sync"></i>');
var e = $(this).attr("rel"), a = $(this).attr("id");
$.ajax({
method: "POST", url: e, dataType: "html", success: function (t) {
$("#" + a + "Content").append(t), $(".dz-load-more i").remove()
}
})
})
}, _ = function () {
jQuery("#lightgallery").length > 0 && $("#lightgallery").lightGallery({
loop: !0,
thumbnail: !0,
exThumbImage: "data-exthumbimage"
})
}, E = function () {
$(".custom-file-input").on("change", function () {
var t = $(this).val().split("\\").pop();
$(this).siblings(".custom-file-label").addClass("selected").html(t)
})
}, F = function () {
var t = $(window).height() - 206;
$(".chatbox .msg_card_body").css("height", t)
}, S = function () {
jQuery("#ckeditor").length > 0 && ClassicEditor.create(document.querySelector("#ckeditor"), {simpleUpload: {uploadUrl: "ckeditor-upload.php"}}).then(t => {
window.editor = t
}).catch(t => {
console.error(t.stack)
})
}, T = function () {
t > 1024 && $(".metismenu li").unbind().each(function (t) {
if ($("ul", this).length > 0) {
var e = $("ul:first", this).css("display", "block"), a = e.offset().left, n = e.width(),
e = $("ul:first", this).removeAttr("style");
$("body").height();
var s = $("body").width();
if (jQuery("html").hasClass("rtl")) var i = a + n <= s; else var i = a > 0;
i ? $(this).find("ul:first").removeClass("left") : $(this).find("ul:first").addClass("left")
}
})
}, q = function () {
$(".chat-rightarea-btn").on("click", function () {
$(this).toggleClass("active"), $(".chat-right-area").toggleClass("active")
}), $(".chat-hamburger").on("click", function () {
$(".chat-left-area").toggleClass("active")
})
}, H = function () {
$(".popup-youtube, .popup-vimeo, .popup-gmaps").length > 0 && $(".popup-youtube, .popup-vimeo, .popup-gmaps").magnificPopup({
disableOn: 700,
type: "iframe",
mainClass: "mfp-fade",
removalDelay: 160,
preloader: !1,
fixedContentPos: !1
})
}, O = function () {
var t = {
init: function () {
var t = document.querySelectorAll(".draggable-zone");
if (0 === t.length) return !1;
new Sortable.default(t, {
draggable: ".draggable",
handle: ".draggable.draggable-handle",
mirror: {appendTo: "body", constrainDimensions: !0}
}).on("drag:stop", () => {
setTimeout(function () {
var t;
t = 0, jQuery(".dropzoneContainer").each(function () {
t = jQuery(this).find(".draggable-handle").length, jQuery(this).find(".totalCount").html(t)
})
}, 200)
})
}
};
jQuery(document).ready(function () {
t.init()
})
}, A = function () {
jQuery("#masonry, .masonry").length > 0 && setTimeout(function () {
jQuery(".filters li").removeClass("active"), jQuery(".filters li:first").addClass("active");
var t = jQuery("#masonry, .masonry"), e = $(".filters li:first").attr("data-filter");
function a(e) {
t.isotope({filter: e})
}
jQuery(".filters").length && (jQuery(".filters li:first").addClass("active"), e = $(".filters li:first").attr("data-filter"), a(e), jQuery(".filters").on("click", "li", function () {
jQuery(".filters li").removeClass("active"), jQuery(this).addClass("active"), e = $(this).attr("data-filter"), a(e)
}))
}, 500)
}, D = function () {
$(".btc-converts").length > 0 && (setTimeout(() => {
"dark" === $("body").attr("data-theme-version") && $(".btc-converts").attr("dark-mode", !0)
}, 1e3), $("#theme_version").on("change", function () {
"dark" === $("body").attr("data-theme-version") ? $(".btc-converts").attr("dark-mode", !0) : $(".btc-converts").attr("dark-mode", !1)
}))
}, I = function () {
if (jQuery(".dz-theme-mode").length > 0) {
jQuery(".dz-theme-mode").on("click", function () {
jQuery(this).toggleClass("active"), jQuery(this).hasClass("active") ? (jQuery("body").attr("data-theme-version", "dark"), setCookie("version", "dark")) : (jQuery("body").attr("data-theme-version", "light"), setCookie("version", "light"))
});
var t = getCookie("version");
null != t && jQuery("body").attr("data-theme-version", t), jQuery(".dz-theme-mode").removeClass("active"), jQuery(window).on("resize", function () {
var t = getCookie("version");
null != t && jQuery("body").attr("data-theme-version", t)
}), setTimeout(function () {
"dark" === jQuery("body").attr("data-theme-version") && jQuery(".dz-theme-mode").addClass("active")
}, 1600)
}
}, M = function (t) {
parseInt($(".header").css("height"), 10), $(".navbar-nav .scroll").on("click", function (t) {
if (t.preventDefault(), jQuery(".navbar-nav .scroll").parent().removeClass("active"), jQuery(this).parent().addClass("active"), "" !== this.hash) {
var e = parseInt($(this.hash).offset().top, 10), a = parseInt($(".header").css("height"), 10);
$("html, body").animate({scrollTop: e - a}, 800, function () {
})
}
}), W()
}, W = function (t) {
if (jQuery(".navbar-nav").length > 0) {
var e = parseInt(jQuery(".header").height(), 10);
jQuery(document).on("scroll", function () {
var t = jQuery(this).scrollTop();
jQuery(".navbar-nav .scroll").each(function () {
var a = jQuery(this);
if (jQuery(a.attr("href")), void 0 != jQuery(this.hash).offset()) var n = parseInt(jQuery(this.hash).offset().top, 10); else var n = 0;
n - e <= t && (a.parent().addClass("active"), a.parent().siblings().removeClass("active"))
})
})
}
}, P = function () {
if (jQuery("input[name=tagify]").length > 0) {
var t = document.querySelector("input[name=tagify]");
new Tagify(t)
}
}, R = function () {
jQuery(".dz-dropdown").on("click", function () {
jQuery("#" + jQuery(this).attr("data-dz-dropdown")).hasClass("hidden") ? (jQuery(".dz-dropdown-menu").addClass("hidden"), jQuery("#" + jQuery(this).attr("data-dz-dropdown")).removeClass("hidden")) : jQuery("#" + jQuery(this).attr("data-dz-dropdown")).addClass("hidden")
}), $(".dropdown-item").click(function () {
$(".dz-dropdown-menu").addClass("hidden")
}), $(document).on("click", function (t) {
$(t.target).closest(".dz-dropdown-menu").length > 0 || $(t.target).closest(".dz-dropdown").length > 0 || $(".dz-dropdown-menu").addClass("hidden")
})
}, U = function () {
jQuery(".dz-popover").on("click", function () {
jQuery("#" + jQuery(this).attr("data-dz-popover")).hasClass("hide") ? (jQuery(".dz-popover-content").fadeOut().addClass("hide"), jQuery("#" + jQuery(this).attr("data-dz-popover")).fadeIn().removeClass("hide")) : jQuery("#" + jQuery(this).attr("data-dz-popover")).fadeOut().addClass("hide")
}), $(document).on("click", function (t) {
$(t.target).closest(".dz-popover-content").length > 0 || $(t.target).closest(".dz-popover").length > 0 || $(".dz-popover-content").fadeOut().addClass("hide")
})
}, B = function () {
jQuery(".dz-modal-btn").on("click", function () {
jQuery("#" + jQuery(this).attr("data-dz-modal")).hasClass("model-close") ? (jQuery(".dz-modal-box").fadeOut("fast").addClass("model-close"), jQuery("#" + jQuery(this).attr("data-dz-modal")).fadeIn("fast", function () {
$(this).removeClass("model-close")
})) : jQuery("#" + jQuery(this).attr("data-dz-modal")).fadeOut("fast").addClass("model-close"), $(document.body).append('<div class="modal-backdrop"></div>'), jQuery(".modal-backdrop").on("click", function () {
$(".dz-modal-box").fadeOut("fast").addClass("model-close"), $(this).remove()
})
}), jQuery(".btn-close , .close-btn ,.save-btn").on("click", function () {
$(".dz-modal-box").fadeOut().addClass("model-close"), $(".modal-backdrop").remove()
})
}, L = function () {
$(".offcanvas-toggle").click(function () {
$("#" + $(this).attr("data-dz-offcanvas")).hasClass("is-closed") ? ($(".offcanvas").addClass("is-closed"), $("#" + $(this).attr("data-dz-offcanvas")).removeClass("is-closed")) : $("#" + $(this).attr("data-dz-offcanvas")).addClass("is-closed"), $(document.body).append('<div class="offcanvas-backdrop"></div>'), $(".offcanvas-backdrop").on("click", function () {
$(this).remove(), $(".offcanvas").addClass("is-closed")
})
}), $(".offcanvas-close").click(function () {
$(".offcanvas").addClass("is-closed"), $(".offcanvas-backdrop").remove()
})
}, N = function () {
$(".card-toggle-btn").click(function () {
$(this).toggleClass("active"), $(this).parent().find(".arrow").toggleClass("arrow-animate"), $(this).parent().find(".content").slideToggle(280)
})
}, V = function () {
$(".accordion-btn").on("click", function () {
if ($(this).closest(".accordion-wrapper").find(".accordion-content").slideUp("hide"), $(this).hasClass("active")) {
$(this).closest(".accordion-wrapper").find(".accordion-btn").removeClass("active"), $(this).removeClass("active");
var t = $(this).attr("data-dz-item");
$("#" + t).slideUp("hide")
} else {
$(this).closest(".accordion-wrapper").find(".accordion-btn").removeClass("active"), $(this).addClass("active");
var t = $(this).attr("data-dz-item");
$("#" + t).slideDown("hide")
}
})
}, j = function () {
$(".tab-btn").on("click", function () {
var t = $(this).attr("data-tab");
$(this).closest(".dz-tab-area").closest_descendent(".nav-tabs,.nav-pills").find(".tab-btn").removeClass("active"), $(this).closest(".dz-tab-area").closest_descendent(".tab-content-area").children().removeClass("show"), $(this).addClass("active"), $(this).closest(".dz-tab-area").find("#" + t).addClass("show")
})
}, G = function () {
$(".metismenu li a").hover(function (t) {
var e = $(this).parent().children("ul"), a = $("#main-wrapper").width(),
n = ($(window).width() - $("#main-wrapper").width()) / 2;
$(this).offset().left + $(this).outerWidth() + e.outerWidth() - n > a && ($(this).parent().parent("ul.metismenu").length > 0 ? e.css({
left: "auto",
right: "0"
}) : e.css({left: "auto", right: "100%"}))
}, function () {
$(this).children("ul").removeAttr("style")
})
}, J = function () {
jQuery(".alert .close-btn").on("click", function () {
$(this).parent(".alert").remove()
})
};
return {
init: function () {
s(), e(), o(), i(), c(), l(), d(), r(), h(), u(), f(), p(), v(), g(), b(), C(), k(), y(), z(), x(), w(), _(), E(), F(), a(), S(), m(), q(), H(), O(), D(), I(), M(), P(), B(), R(), U(), N(), L(), V(), j(), J(), setTimeout(function () {
G()
}, 500)
}, load: function () {
n(), A()
}, resize: function () {
F(), r()
}, handleMenuPosition: function () {
T()
}
}
}();
!function (t) {
t.fn.closest_descendent = function (e) {
for (var a = t(), n = this; n.length && !(a = n.filter(e)).length;) n = n.children();
return a.first()
}
}(jQuery), jQuery(document).ready(function () {
"use strict";
W3Crm.init()
}), jQuery(window).on("load", function () {
"use strict";
W3Crm.load(), setTimeout(function () {
W3Crm.handleMenuPosition()
}, 1e3)
}), jQuery(window).on("resize", function () {
"use strict";
W3Crm.resize(), setTimeout(function () {
W3Crm.handleMenuPosition()
}, 1e3)
});