(function(e,t){"use strict";window.VAMTAM_FRONT.elementor=window.VAMTAM_FRONT.elementor||{};var n={domLoaded:function(){this.VamtamMainNavHandler.init(),this.VamtamActionLinksHandler.init(),this.VamtamPopupToggleHandler.init(),this.VamtamPopupsHandler.init()},pageLoaded:function(){this.VamtamWidgetsHandler.stickyInsideParentFix()},VamtamMainNavHandler:{init:function(){this.fixMenuDrodownScrolling()},fixMenuDrodownScrolling:function(){var t=e(".elementor-location-header .elementor-nav-menu--dropdown-tablet .elementor-nav-menu--dropdown.elementor-nav-menu__container").first(),n=t.siblings(".elementor-menu-toggle")[0];if(t.length&&n.length){var o=function(){if(e(n).hasClass("elementor-active")){var i=e("html").hasClass("ios-safari")?t[0].getBoundingClientRect().top+100:t[0].getBoundingClientRect().top;t.css("max-height","calc(100vh - "+i+"px)"),n.removeEventListener("click",o)}};n.addEventListener("click",o)}}},VamtamActionLinksHandler:{init:function(){this.popupActionLinks()},popupActionLinks:function(){var t=this,n=window.VAMTAM.isBelowMaxDeviceWidth(),o=[],i=function(t,n,o){var i=e("#elementor-popup-modal-"+t),s=e(i).find(".dialog-widget-content"),a=window.VAMTAM.adminBarHeight;if(s.length&&n){var r,l=n.getBoundingClientRect();o?e(s).css({top:"",left:""}):(e(s).css({top:l.bottom-a,left:l.left}),r=setInterval(function(){"none"===e(i).css("display")&&(e(s).css({top:"",left:""}),clearInterval(r))},500))}},s=function(e){o.forEach(function(t){e?i(t.id,t.parent,!0):i(t.id,t.parent)})},a=function(){var e=window.VAMTAM.isBelowMaxDeviceWidth();n!==e?(e?s(!0):s(),n=e):e||s()},r=function(e,t){var n;o.forEach(function(o){o.id===e&&(o.parent=t,n=!0)}),n||o.push({id:e,parent:t})},l=function(n){var o=e(n.currentTarget).attr("href");if(o){var s=t.utils.getSettingsFromActionLink(o);s&&s.align_with_parent&&(r(s.id,n.currentTarget),window.VAMTAM.isMaxDeviceWidth()&&i(s.id,n.currentTarget),window.removeEventListener("resize",a),window.addEventListener("resize",a,!1))}};elementorFrontend.elements.$document.on("click",'a[href^="#elementor-action"]',l);const c=function(){const n=e('a[href^="#elementor-action"]');n.length&&e.each(n,(n,o)=>{const i=e(o).attr("href"),s=t.utils.getSettingsFromActionLink(i);if(s&&s.use_vamtam_popup_toggle){const t=e(o).parents(".elementor-widget").first();t.length&&t.addClass("vamtam-popup-toggle")}})};c()},utils:{getSettingsFromActionLink:function(e){if(e=decodeURIComponent(e),e){var t=e.match(/settings=(.+)/),n={};return t&&(n=JSON.parse(atob(t[1]))),n}},getActionFromActionLink:function(e){if(e=decodeURIComponent(e),e){var t=e.match(/action=(.+?)&/);if(t){var n=t[1];return n}}}}},VamtamPopupToggleHandler:{init:function(){function n(t,n,o){var i,s;if(t.classList.contains("elementor-widget-icon")&&(i=e(t).find(".elementor-icon svg, .elementor-icon").first()[0],s=e(n).find(".elementor-icon svg, .elementor-icon").first()[0]),i&&o!==i)return{innermostEl:i,innermostElClone:s}}function o(e,t){e.classList.contains("elementor-widget-button")?i(e,t,"button"):e.classList.contains("elementor-widget-icon")?i(e,t,"icon"):i(e,t)}function i(t,n,o){var i=e(t).find('*:not(:has("*"))').first()[0],a=e(n).find('*:not(:has("*"))').first()[0];switch(o){case"button":s(i,a,o);var r=e(t).find(".elementor-button").first()[0],l=e(n).find(".elementor-button").first()[0];s(r,l,o),s(t,n,o);break;case"icon":var c=e(t).find(".elementor-icon svg, .elementor-icon i").first()[0],d=e(n).find(".elementor-icon svg, .elementor-icon i").first()[0];s(c,d,o),s(t,n,o);break;default:s(i,a),s(t,n)}}function s(e,t,n){if(e&&t){var o=window.getComputedStyle(e,null);switch(n){case"icon":Object.assign(t.style,{font:""!==o.getPropertyValue("font")?o.getPropertyValue("font"):`${o.getPropertyValue("font-style")} ${o.getPropertyValue("font-variant")} ${o.getPropertyValue("font-weight")} ${o.getPropertyValue("font-size")}/${o.getPropertyValue("line-height")} ${o.getPropertyValue("font-family")}`,width:o.getPropertyValue("width"),height:o.getPropertyValue("height"),color:o.getPropertyValue("color"),fill:o.getPropertyValue("fill"),stroke:o.getPropertyValue("stroke")});break;case"button":default:Object.assign(t.style,{font:""!==o.getPropertyValue("font")?o.getPropertyValue("font"):`${o.getPropertyValue("font-style")} ${o.getPropertyValue("font-variant")} ${o.getPropertyValue("font-weight")} ${o.getPropertyValue("font-size")}/${o.getPropertyValue("line-height")} ${o.getPropertyValue("font-family")}`,width:o.getPropertyValue("width"),height:o.getPropertyValue("height"),color:o.getPropertyValue("color")})}}}var a=document.querySelectorAll(".vamtam-popup-toggle"),r=[],l=window.VAMTAM.isBelowMaxDeviceWidth();if(!a.length)return;const c=function(t,n,o=!1){var i,s=!0;t&&(o||t.preventDefault(),s=!1),r.forEach(function(e){(n.isSameNode(e.toggle)||n.isSameNode(e.toggleClone))&&(i=e)});var a=i.toggle.getBoundingClientRect(),l=i.innermostEl.getBoundingClientRect();if(o||requestAnimationFrame(()=>{Object.assign(i.toggleClone.style,{top:a.top+"px",left:a.left+"px"}),Object.assign(i.innermostElClone.style,{position:"fixed",top:l.top+"px",left:l.left+"px"})}),s)return;const c=()=>{if(i.modalParent=e(`#elementor-popup-modal-${i.modalId}`),i.modalContent=i.modalParent&&e(i.modalParent).find(".dialog-message.dialog-lightbox-message"),!i.modalSettings){const t=e(i.modalContent).find(`[data-elementor-id="${i.modalId}"]`);t.length&&(i.modalSettings=JSON.parse(e(t).attr("data-elementor-settings")))}};if(c(),i.popupToggleActive){if(!i.toggleClone.classList.contains("is-clickable"))return;if(o&&i.modalId)if("keyup"===t.type){if(i.modalSettings&&"yes"===i.modalSettings.prevent_close_on_esc_key)return}else if("click"===t.type){if(i.modalSettings&&"yes"===i.modalSettings.prevent_close_on_background_click)return;if(i.modalContent.length&&i.modalContent[0]&&(t.target.isSameNode(i.modalContent[0])||i.modalContent[0].contains(t.target)))return}requestAnimationFrame(function(){i.toggle.classList.remove("clone-active"),i.toggleClone.classList.remove("is-active"),i.toggleClone.classList.remove("is-clickable"),i.toggleClone.classList.add("is-closed"),i.popupToggleActive=!1})}else requestAnimationFrame(function(){i.toggleClone.classList.remove("is-closed"),i.toggleClone.classList.add("is-active"),i.toggle.classList.add("clone-active"),i.toggleClone.classList.add("is-clickable"),i.popupToggleActive=!0});!o&&i.modalId&&setTimeout(()=>{c()},1e3)},d=function(){const t=document.querySelectorAll(".vamtam-popup-toggle-clone.is-active"),n=window.VAMTAM.isBelowMaxDeviceWidth(),i=()=>{t.forEach(function(t){e(t).click()})};l!==n&&(i(),r.forEach(function(e){o(e.toggle,e.toggleClone)}),l=n),t.forEach(function(e){requestAnimationFrame(()=>{e.classList.add("hidden")}),c(null,e),setTimeout(()=>{e.classList.remove("hidden")},700)})};a.forEach(function(i){var s=i.cloneNode(!0),a=e(i).find('*:not(:has("*"))').first()[0],l=e(s).find('*:not(:has("*"))').first()[0],c=e(i).find('a[href^="%23elementor-action"], a[href^="#elementor-action"]'),d=c.length&&window.VAMTAM_FRONT.elementor.urlActions.getSettingsFromActionLink(e(c).attr("href")),g=d&&d.id;s.classList.add("vamtam-popup-toggle-clone");const m=n(i,s,a);m&&(a=m.innermostEl,l=m.innermostElClone),o(i,s),r.push({popupToggleActive:!1,toggle:i,toggleClone:s,innermostEl:a,innermostElClone:l,modalId:g,modalParent:t,modalContent:t,modalSettings:t}),document.body.appendChild(s)}),document.body.addEventListener("click",function(t){var n=!!t.target.classList.contains("vamtam-popup-toggle")&&t.target||t.target.closest(".vamtam-popup-toggle"),o=document.querySelectorAll(".vamtam-popup-toggle-clone.is-active"),i=n&&n.classList.contains("vamtam-popup-toggle-clone");const s=()=>{let o=!1,i=e(t.target).attr("href");o=i?i.startsWith("%23elementor-action")||i.startsWith("#elementor-action"):t.target.closest('a[href^="%23elementor-action"], a[href^="#elementor-action"]'),o&&c(t,n)},a=()=>{o.forEach(function(e){c(t,e,!0)})};!n||i||o.length?o.length&&(a(),n&&!i&&s()):s()}),document.body.addEventListener("keyup",function(e){if("Escape"===e.key){var t=document.querySelectorAll(".vamtam-popup-toggle-clone.is-active");t.forEach(function(t){c(e,t,!0)})}}),window.addEventListener("resize",window.VAMTAM.debounce(d,100),!1)}},VamtamPopupsHandler:{init:function(){this.disablePopupAutoFocus(),this.enablePageTransitionsForPopupLinks()},disablePopupAutoFocus:function(){elementorFrontend.elements.$window.on("elementor/popup/show elementor/popup/hide",e=>{setTimeout(()=>{"input"!==document.activeElement.nodeName&&document.activeElement.blur()},100)})},enablePageTransitionsForPopupLinks(){if(!elementorFrontend.config.experimentalFeatures["page-transitions"])return;let e=jQuery("e-page-transition");if(!e.length)return;e=e[0];const t=e.getAttribute("triggers");if(t)return;const n='.elementor-popup-modal a:not([data-elementor-open-lightbox="yes"])',o=e.onLinkClick;o&&jQuery(document).on("click",n,o.bind(e))}},VamtamWidgetsHandler:{stickyInsideParentFix:()=>{const e=document.querySelectorAll('.elementor-sticky[data-settings*=\'"sticky_parent":"yes"\']');e.length&&e.forEach(e=>{window.VAMTAM_FRONT.WidgetsResizeObserver.observe(e,function(){window.VAMTAM.debounce(window.dispatchEvent(new Event("resize")),500)})})}},WidgetsObserver:{observer:null,targetsMap:new Map,init(){this.observer||(this.observer=new IntersectionObserver(this.handleIntersect.bind(this),{root:null,threshold:0,rootMargin:"0px"}))},observe(e,t,n={once:!0}){this.init(),this.targetsMap.has(e)||(this.targetsMap.set(e,{onIntersect:t,options:n}),this.observer.observe(e))},unobserve(e){this.targetsMap.has(e)&&(this.targetsMap.delete(e),this.observer.unobserve(e))},handleIntersect(e){e.forEach(e=>{if(this.targetsMap.has(e.target)){const{onIntersect:t,options:n}=this.targetsMap.get(e.target);e.isIntersecting&&(t(),n.once&&this.unobserve(e.target))}})}},WidgetsResizeObserver:{observer:null,targetsMap:new Map,init(){this.observer||(this.observer=new ResizeObserver(this.handleResize.bind(this)))},observe(e,t){this.init(),this.targetsMap.has(e)||(this.targetsMap.set(e,{onElementResize:t}),this.observer.observe(e))},unobserve(e){this.targetsMap.has(e)&&(this.targetsMap.delete(e),this.observer.unobserve(e))},handleResize(e){e.forEach(e=>{if(this.targetsMap.has(e.target)){const{onElementResize:t}=this.targetsMap.get(e.target);t()}})}}};window.VAMTAM_FRONT.elementor.urlActions=n.VamtamActionLinksHandler.utils,window.VAMTAM_FRONT.WidgetsObserver=n.WidgetsObserver,window.VAMTAM_FRONT.WidgetsResizeObserver=n.WidgetsResizeObserver,e(document).ready(function(){n.domLoaded()}),e(window).on("load",function(){n.pageLoaded()});class o extends elementorModules.frontend.handlers.Base{onInit(...e){super.onInit(...e),this.checkAddBaseThemeStylesClass()}checkAddBaseThemeStylesClass(){const t=e("body").hasClass("elementor-editor-active");t&&this.isWidgetModActive()&&this.$element.addClass("vamtam-has-theme-widget-styles")}isWidgetModActive(){const e=elementorFrontend.getKitSettings(),t="vamtam_theme_",n=window.VAMTAM_FRONT.widget_mods_list;let o=this.getElementType();return"widget"===o&&(o=this.getWidgetType()),!!n[o]&&("yes"===e[`${t}enable_all_widget_mods`]||"yes"!==e[`${t}disable_all_widget_mods`]&&"yes"===e[`${t}${o}`])}}jQuery(window).on("elementor/frontend/init",()=>{const e=e=>{elementorFrontend.elementsHandler.addHandler(o,{$element:e})};elementorFrontend.hooks.addAction("frontend/element_ready/global",e)})})(jQuery);