// wowslider initialization
(function(){function p(a){var k={};"anim-type hidecontrols theme fullscreen timeout autoplay duration paddingtop paddingbottom showbullets height width responsive showcaptions captionseffect".split(" ").map(function(b){k[b]=a.attr("data-"+b)});return k}if("undefined"!==typeof bootstrap&&bootstrap.Tooltip.VERSION.startsWith("5")){var q=Array.from(document.body.children).filter(function(a){return!a.matches("style, script")});q.push(document);q.forEach(function(a){a.addEventListener("add.cards",function(a){if($(a.target).hasClass("mbr-wowslider-container")){$(a.target).find(".mbr-wowslider-options").css("display",
"none");var b=$(a.target).closest("html").hasClass("is-builder"),c={},c=p($(a.target).find(".params")),f=$(a.target).find(".mbr-wowslider");"false"==c.showbullets&&$(a.target).find(".ws_bullets").css("display","none");var l=!1;"true"!=c.autoplay||b||(l=!0);var g=!1;"true"==c.showcaptions&&(g=!0);var h=!1;if("boundary"==c.theme||"dodgy"==c.theme)h=[],$(".ws_bullets img").each(function(a,b){h.push($(this).attr("src"))});"utter"==c.theme&&(h=[],$(".ws_images img").each(function(a,b){h.push($(this).attr("src"))}));
f.css({"padding-top":1.5*+c.paddingtop+"rem","padding-bottom":1.5*+c.paddingbottom+"rem"});var m=0,n="ws_"+c["anim-type"],e=setInterval(function(){m++;if(10<m||window[n])clearInterval(e),$(a.target).find(".mbr-wowslider").wowSlider({effect:c["anim-type"],prev:"",next:"",duration:1E3*+c.duration,delay:1E3*+c.timeout,width:+c.width,height:+c.height,autoPlay:l,autoPlayVideo:!1,playPause:!0,stopOnHover:!1,loop:!1,bullets:1,caption:g,captionEffect:c.captionseffect,onStep:function(a){f.attr("data-cur-slide",
a)},controls:!0,controlsThumb:h,responsive:+c.responsive,fullScreen:!1,gestures:2,onBeforeStep:0,images:0})},200),d=$(a.target).attr("id"),r="style-"+d;$("head").find("#"+r).remove();text='<style id="'+r+'">';1==c.responsive&&(text+="#"+d+" .mbr-wowslider.boxed{max-width:"+c.width+"px;max-height:"+c.height+"px;margin:0 auto} \n",f.addClass("boxed"));2==c.responsive&&(text+="#"+d+" .mbr-wowslider.full-width{max-height:"+c.height+"px !important} \n",text+="#"+d+" .mbr-wowslider.full-width .ws_images>div>img{max-height:"+
c.height+"px !important} \n",f.addClass("full-width"));"true"==c.hidecontrols&&(text+="#"+d+" .mbr-wowslider a.ws_next, #"+d+" a.ws_prev, #"+d+" .ws_playpause{display: none} \n",text+="#"+d+" .mbr-wowslider:hover a.ws_next, #"+d+" .mbr-wowslider:hover a.ws_prev, #"+d+"  .mbr-wowslider:hover .ws_playpause{display: block} \n");text+="</style>";$("head").append(text);b&&(f.css("cursor","pointer"),$(".ws_cover").on("click",function(){$(a.target).closest(".app-component").find(".component-params").click()}))}})})}$(document).on("add.cards change.cards",
function(a){if($(a.target).hasClass("mbr-wowslider-container")){$(a.target).find(".mbr-wowslider-options").css("display","none");var k=$(a.target).closest("html").hasClass("is-builder"),b={},b=p($(a.target).find(".params")),c=$(a.target).find(".mbr-wowslider");"false"==b.showbullets&&$(a.target).find(".ws_bullets").css("display","none");var f=!1;"true"!=b.autoplay||k||(f=!0);var l=!1;"true"==b.showcaptions&&(l=!0);var g=!1;if("boundary"==b.theme||"dodgy"==b.theme)g=[],$(".ws_bullets img").each(function(a,
b){g.push($(this).attr("src"))});"utter"==b.theme&&(g=[],$(".ws_images img").each(function(a,b){g.push($(this).attr("src"))}));c.css({"padding-top":1.5*+b.paddingtop+"rem","padding-bottom":1.5*+b.paddingbottom+"rem"});var h=0,m="ws_"+b["anim-type"],n=setInterval(function(){h++;if(10<h||window[m])clearInterval(n),$(a.target).find(".mbr-wowslider").wowSlider({effect:b["anim-type"],prev:"",next:"",duration:1E3*+b.duration,delay:1E3*+b.timeout,width:+b.width,height:+b.height,autoPlay:f,autoPlayVideo:!1,
playPause:!0,stopOnHover:!1,loop:!1,bullets:1,caption:l,captionEffect:b.captionseffect,onStep:function(a){c.attr("data-cur-slide",a)},controls:!0,controlsThumb:g,responsive:+b.responsive,fullScreen:!1,gestures:2,onBeforeStep:0,images:0})},200),e=$(a.target).attr("id"),d="style-"+e;$("head").find("#"+d).remove();text='<style id="'+d+'">';1==b.responsive&&(text+="#"+e+" .mbr-wowslider.boxed{max-width:"+b.width+"px;max-height:"+b.height+"px;margin:0 auto} \n",c.addClass("boxed"));2==b.responsive&&(text+=
"#"+e+" .mbr-wowslider.full-width{max-height:"+b.height+"px !important} \n",text+="#"+e+" .mbr-wowslider.full-width .ws_images>div>img{max-height:"+b.height+"px !important} \n",c.addClass("full-width"));"true"==b.hidecontrols&&(text+="#"+e+" .mbr-wowslider a.ws_next, #"+e+" a.ws_prev, #"+e+" .ws_playpause{display: none} \n",text+="#"+e+" .mbr-wowslider:hover a.ws_next, #"+e+" .mbr-wowslider:hover a.ws_prev, #"+e+"  .mbr-wowslider:hover .ws_playpause{display: block} \n");text+="</style>";$("head").append(text);
k&&(c.css("cursor","pointer"),$(".ws_cover").on("click",function(){$(a.target).closest(".app-component").find(".component-params").click()}))}});$(function(){function a(a){return!1}setTimeout(function(){$(".ui-sortable").on("click",".ws_controls > .ws_next",a);$(".ui-sortable").on("click",".ws_controls > .ws_prev",a)},0)});$(document).on("sortstop",function(a){$(a.target).closest("#edit-component-params").find('select[name="animType"]').trigger("change")})})();
