(()=>{"use strict";window.addEventListener("elementor/frontend/init",()=>{const e=elementorModules.frontend.handlers.Base.extend({bindEvents:function(){this.run()},getDefaultSettings:function(){return{allowHTML:!0}},onElementChange:debounce(function(e){-1!==e.indexOf("element_pack_agbg_")&&this.run()},400),settings:function(e){return this.getElementSettings(`element_pack_agbg_${e}`)},parseColor:function(e){if(/^rgba?\((\d+),\s*(\d+),\s*(\d+),?\s*([\d.]*)\)$/.test(e)){const[,t,n,r,s="1"]=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+),?\s*([\d.]*)\)$/);if(1===parseFloat(s))return`#${((1<<24)+(parseInt(t,10)<<16)+(parseInt(n,10)<<8)+parseInt(r,10)).toString(16).slice(1)}`;return`rgba(${t}, ${n}, ${r}, .${s.toString().split(".")[1]||"0"})`}if(/^#([A-Fa-f0-9]{8})$/.test(e)){const t=e.match(/[A-Fa-f0-9]{2}/g).map(e=>parseInt(e,16)),n=parseFloat((t[3]/255).toFixed(2));if(1===n)return`#${e.slice(1,7)}`;const r=n.toString().split(".")[1]||"0";return`rgba(${t[0]}, ${t[1]}, ${t[2]}, .${r})`}if(/^#([A-Fa-f0-9]{6})$/.test(e))return e.toLowerCase();if(/^hsla?\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,?\s*([\d.]*)\)$/.test(e)){const[,t,n,r,s="1"]=e.match(/^hsla?\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,?\s*([\d.]*)\)$/);if(1===parseFloat(s))return`hsl(${t}, ${n}%, ${r}%)`;return`hsla(${t}, ${n}%, ${r}%, .${s.toString().split(".")[1]||"0"})`}return e},run:function(){if("yes"!==this.settings("show"))return;const e=this.$element.data("id"),t=document.querySelector(`.elementor-element-${e}`);if(!t)return;let n=t.querySelector(".bdt-animated-gradient-background");n||(n=document.createElement("canvas"),n.id=`canvas-basic-${e}`,n.className="bdt-animated-gradient-background",t.prepend(n));const r=n.id,s=this.settings("color_list").map(e=>[this.parseColor(e.start_color),this.parseColor(e.end_color)]),a=this.settings("direction")||"diagonal",i=this.settings("transitionSpeed.size")||5500;if("undefined"==typeof Granim)return void console.error("Granim library is not loaded");new Granim({element:`#${r}`,direction:a,isPausedWhenNotInView:!0,states:{"default-state":{gradients:s,transitionSpeed:i}}})}});elementorFrontend.hooks.addAction("frontend/element_ready/section",t=>{elementorFrontend.elementsHandler.addHandler(e,{$element:t})}),elementorFrontend.hooks.addAction("frontend/element_ready/container",t=>{elementorFrontend.elementsHandler.addHandler(e,{$element:t})})})})();