function addMsgErrorDropzone(){$(".dropzone").hasClass("has-img")&&($(".tools.final").length>0||$(".tools.preview").length>0?$(".msg-dropzone-error").remove():$(".dropzone").append("<div class='msg-dropzone-error'>Saving image is required <i class='fa fa-exclamation-triangle'><\/div>"))}function resetValueDropzone(){$(document).on("click",".tools .btn-edit",function(){$("#imageUrl").val("");$("#dropzonefile").val("");$(".dropzone").removeClass("done");$(".msg-dropzone-error").remove()})}function setScrollPos(n){localStorage.setItem(n,$(window).scrollTop())}function getScrollPos(n){var t=localStorage.getItem(n,0);t&&$(window).scrollTop(t)}function readMore(n,t){var i=n,t=t,f=i.children(".readall-wrap").outerHeight(),r="readall",u="Read less";i.hasClass(r)&&(u="Read more",f="",scrollToEl(i));i.toggleClass(r).css("height",f);t.toggleClass(r).attr("title",u).text(u)}if($(".nav-scroll").length)if("ontouchstart"in document.documentElement)$(".nav-scroll > li").on("touchstart",function(){$(this).siblings().removeClass("open-sub");$(this).addClass("open-sub")});else{var maxHeightSub=375,listouterHeight="height: auto",$list,$lastli,height=1,$wholeHeight=0,multiplier=0,spaceScroll,realTop,scrollHeightCustom,unitScroll;$("[data-scroll-height]").length&&(scrollHeightCustom=$(".nav-scroll").attr("data-scroll-height"),$.isNumeric(scrollHeightCustom)&&(maxHeightSub=scrollHeightCustom));$(function(){$(".nav-scroll > li").on("mouseenter",function(){var n=$(this),r=$(this).height,i=n.find("a"),t;if(i.addClass("hover"),n.find("[data-sub-menu]").length&&($list=n.find("[data-sub-menu]"),$lastli=$list.find("li:last-child"),height=$list.height()*1.1,$wholeHeight=$list.outerHeight(),multiplier=height/maxHeightSub,t=Math.abs(maxHeightSub-$wholeHeight),unitScroll=$list.offset().top>0?$list.height()-maxHeightSub:$list.height()-maxHeightSub-n.outerHeight(!0),spaceScroll=unitScroll>0?-unitScroll:unitScroll,t>60?$wholeHeight+60>maxHeightSub&&($wholeHeight=maxHeightSub):spaceScroll=0,listouterHeight="height:"+$wholeHeight+"px",n.data("origHeight",n.height()),$list.wrap("<div class='wrapper-scroll' style="+listouterHeight+"><\/div>").show()),multiplier>1)n.on("mousemove",function(t){var r=n.offset(),i=(t.pageY-r.top)*multiplier-n.data("origHeight")*multiplier;i>n.data("origHeight")&&(realTop=-i+n.data("origHeight"),realTop>spaceScroll?$list.css("top",realTop):$list.css("top",spaceScroll))})}).on("mouseleave",function(){var n=$(this);n.height($(this).data("origHeight")).find("[data-sub-menu]").unwrap().css({top:0}).hide().end().find("a").removeClass("hover")})})}$(document).ready(function(){function e(t){var e=t.closest(n).find("input:checked"),s=e.length,i=t.closest(n).find(f),c=i.data("placeholder"),h=i.find("span"),l=t.closest(n).attr("dropdown-selected-placeholder")||"Selected",u=t.closest(n).find(".selected-items")[0];t.closest(n).find(r).html("All");s>0?(h.text(l+" ("+s+")"),i.addClass("selected"),o(t,u,e)):(u&&(u.innerHTML=""),h.text(c),i.removeClass("selected"))}function s(i){var u=i.closest(n).find("input"),f=i.children(r);i.hasClass("selectedAll")?(u.prop("checked",!1).change(),f.html("All"),u.closest(t).removeClass("hidden")):(u.prop("checked",!0).change(),f.html("None"));i.toggleClass("selectedAll")}function o(u,f,e){var s=u.closest(n).find("input").length,o=e.length;o==s?(u.closest(n).find(r).html("None"),u.closest(n).find(i).addClass("selectedAll")):(u.closest(n).find(r).html("All"),u.closest(n).find(i).removeClass("selectedAll"));o>0&&f&&(f.innerHTML="",e.each(function(){const i=this.defaultValue,r=this.getAttribute("text-content"),n=$("<li>"),u=$("<i>",{"class":"delete-selected fa-solid fa-xmark","delete-value":i}),e=$("<span>").text(r);n.append(u,e);$(f).append(n);$(this).closest(t).addClass("hidden")}))}$(".lazy")&&$(".lazy").lazy();$(document).on("click","[data-selected-items] .delete-selected",function(){var n=$(this).closest(u).find('input[value="'+$(this).attr("delete-value")+'"]');n.trigger("click");n.closest(t).removeClass("hidden")});var n="[dropdown-select]",f="[dropdown-control]",u="[dropdown-content]",t="[dropdown-option]",i="[dropdown-unselectall]",r="[dropdown-select-text]";if(n.length)$(document).on("click",f,function(t){if(t.preventDefault(),$(this).next().hasClass("show")||($(u).removeClass("show"),$(n).removeClass("show")),$(this).next().length!=0){$(this).next().stop().toggleClass("show");$(this).closest(n).toggleClass("show");var i=$(this).closest(n).find(".selected-items")[0],r=$(this).closest(n).find("input:checked");o($(this),i,r)}});if(i.length)$(document).on("click",i,function(n){n.preventDefault();s($(this));e($(this))});if(t.length)$(document).on("click",t,function(){e($(this))});$(document).bind("click",function(t){$(t.target).parents().is(n)||$(t.target).is("[delete-value]")||($(u).removeClass("show"),$(n).removeClass("show"))})});var scrollToEl=function(n){var t=n.offset().top-60;$("html, body").animate({scrollTop:t},500)},readallBtn=$(".readall-btn"),readallContent=$(".readall-content"),readallShadow=$(".readall-shadow"),readallContentHeight=readallContent.children(".readall-wrap").outerHeight();readallContentHeight<240&&(readallBtn.hide(),readallShadow.hide(),readallContent.css("height","auto"));$(document).ready(function(){readallBtn.on("click",function(){var n=$(this),t=$(this).prev(readallContent);readMore(t,n)})});$(document).on("click",'.auto-scroll a[href^="#"]',function(n){n.preventDefault();var t=$("header nav").innerHeight();$("html, body").animate({scrollTop:$($.attr(this,"href")).offset().top-t},500)});$(document).ready(function(n){var i=n(".hero-slider"),t;i.length>0&&i.slick({dots:!1,arrows:!1,infinite:!0,speed:600,fade:!0,cssEase:"linear",autoplay:!0,autoplaySpeed:4e3,pauseOnFocus:!1,pauseOnHover:!1});t=n("[sortable-group]");t.length>0&&t.each(function(){let t=n(this)[0];new Sortable(t,{handle:".handle",animation:150})})})