1try{ 2try{ 3 4var astraGetParents=function(e,t){for(var a=[];e&&e!==document;e=e.parentNode)(!t||e.matches(t))&&a.push(e);return a},astraToggleClass=function(e,t){e.classList.contains(t)?e.classList.remove(t):e.classList.add(t)},astraTriggerEvent=function(e,t){t=new CustomEvent(t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:{});e.dispatchEvent(t)};astraSmoothScroll=function(e,t){e.preventDefault(),window.scrollTo({top:t,left:0,behavior:"smooth"})},astScrollToTopHandler=function(e,t){var a=getComputedStyle(t).content,n=t.dataset.onDevices,a=a.replace(/[^0-9]/g,"");"both"==n||"desktop"==n&&"769"==a||"mobile"==n&&""==a?(n=window.pageYOffset||document.body.scrollTop,e&&e.length?n>e.offsetHeight+100?t.style.display="block":t.style.display="none":300<window.pageYOffset?t.style.display="block":t.style.display="none"):t.style.display="none"},(()=>{var r=document.querySelectorAll("#masthead .main-header-menu-toggle"),g=document.getElementById("masthead"),i={},c="",d=document.body,p="";function e(e){c=e.detail.type;e=document.querySelectorAll(".menu-toggle");"dropdown"===c&&(document.getElementById("ast-mobile-popup").classList.remove("active","show"),h("updateHeader")),"off-canvas"===c&&e.forEach(function(e){e&&e.classList.contains("toggled")&&e.click()}),t(c)}function h(e){p=g.querySelector("#ast-mobile-header");if(null==p||"dropdown"!==p.dataset.type||"updateHeader"===e){(void 0!==e&&"updateHeader"!==e?e.closest(".ast-mobile-popup-inner"):document.querySelector("#ast-mobile-popup")).querySelectorAll(".menu-item-has-children").forEach(e=>{e.classList.remove("ast-submenu-expanded"),Array.from(e.querySelectorAll(".sub-menu")).forEach(e=>{e.hasAttribute("data-initial-display")||e.setAttribute("data-initial-display",window.getComputedStyle(e).display),"block"===e.getAttribute("data-initial-display")?e.style.display="block":e.style.display="none"})});var t=document.querySelectorAll(".menu-toggle");document.body.classList.remove("ast-main-header-nav-open","ast-popup-nav-open"),document.documentElement.classList.remove("ast-off-canvas-active");for(var a=0;a<t.length;a++)t[a].classList.remove("toggled"),t[a].setAttribute("aria-expanded","false"),t[a].style.display="flex"}}function t(e){var a=document.querySelectorAll("#ast-mobile-header .menu-toggle"),n=document.querySelectorAll("#ast-desktop-header .menu-toggle");if(void 0===e&&null!==g)if(p=g.querySelector("#ast-mobile-header"))e=p.dataset.type;else{var s=g.querySelector("#ast-desktop-header");if(!s)return;e=s.dataset.toggleType}if("off-canvas"===e){var s=document.getElementById("menu-toggle-close"),o=document.querySelector(".ast-mobile-popup-inner");if(null!=o){popupLinks=o.getElementsByTagName("a"),document.removeEventListener("keydown",l),document.addEventListener("keydown",l),s&&s.addEventListener("click",i),document.addEventListener("keyup",function(e){"Escape"===e.key&&i()}),document.addEventListener("click",function(e){e.target===document.querySelector(".ast-mobile-popup-drawer.active .ast-mobile-popup-overlay")&&i()});for(var r=0;r<a.length;r++)a[r].removeEventListener("click",astraNavMenuToggle,!1),a[r].removeEventListener("click",popupTriggerClick),a[r].addEventListener("click",function(e){e.currentTarget.setAttribute("aria-expanded","true"),popupTriggerClick(e),document.querySelector(".ast-mobile-popup-drawer.active")||i()},!1),a[r].trigger_type="mobile";for(r=0;r<n.length;r++)n[r].removeEventListener("click",astraNavMenuToggle,!1),n[r].removeEventListener("click",popupTriggerClick),n[r].addEventListener("click",function(e){e.currentTarget.setAttribute("aria-expanded","true"),popupTriggerClick(e)},!1),n[r].trigger_type="desktop";let t=document.querySelector(".ast-button-wrap .menu-toggle");s.addEventListener("click",function(e){document.getElementById("ast-mobile-popup").classList.remove("active","show"),h(this),window.self===window.top&&t?.focus()}),document.addEventListener("keyup",function(e){"Escape"===e.key&&(e.preventDefault(),document.getElementById("ast-mobile-popup").classList.remove("active","show"),h(),t?.focus())}),document.addEventListener("click",function(e){e.target===document.querySelector(".ast-mobile-popup-drawer.active .ast-mobile-popup-overlay")&&(document.getElementById("ast-mobile-popup").classList.remove("active","show"),h(),t?.focus())});for(let e=0,t=popupLinks.length;e<t;e++)null!==popupLinks[e].getAttribute("href")&&(popupLinks[e].getAttribute("href").startsWith("#")||-1!==popupLinks[e].getAttribute("href").search("#"))&&(!popupLinks[e].parentElement.classList.contains("menu-item-has-children")||popupLinks[e].parentElement.classList.contains("menu-item-has-children")&&document.querySelector("header.site-header").classList.contains("ast-builder
4-menu-toggle-icon"))&&(popupLinks[e].addEventListener("click",v,!0),popupLinks[e].headerType="off-canvas");function l(e){var t,a=document.getElementById("ast-mobile-popup");a&&a.classList.contains("active")&&"Tab"===e.key&&(a=o.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),0!==(a=Array.prototype.filter.call(a,function(e){return 0<e.offsetWidth&&0<e.offsetHeight&&"hidden"!==window.getComputedStyle(e).visibility})).length)&&(t=a[0],a=a[a.length-1],e.shiftKey&&document.activeElement===t?(e.preventDefault(),a.focus()):e.shiftKey||document.activeElement!==a||(e.preventDefault(),t.focus()))}function i(){document.removeEventListener("keydown",l)}AstraToggleSetup()}}else if("dropdown"===e){var t=document.querySelectorAll(".ast-mobile-header-content")||!1,s=document.querySelector(".ast-desktop-header-content")||!1;if(0<t.length)for(let e=0;e<t.length;e++){var c=t[e].getElementsByTagName("a");for(link=0,len=c.length;link<len;link++){var d=null===c[link].closest(".wp-block-uagb-tabs");null!==c[link].getAttribute("href")&&(c[link].getAttribute("href").startsWith("#")||-1!==c[link].getAttribute("href").search("#"))&&(!c[link].parentElement.classList.contains("menu-item-has-children")||c[link].parentElement.classList.contains("menu-item-has-children")&&document.querySelector("header.site-header").classList.contains("ast-builder-menu-toggle-icon"))&&d&&(c[link].addEventListener("click",v,!0),c[link].headerType="dropdown")}}if(s){var u=s.getElementsByTagName("a");for(link=0,len=u.length;link<len;link++){var m=null===u[link].closest(".wp-block-uagb-tabs");null!==u[link].getAttribute("href")&&(u[link].getAttribute("href").startsWith("#")||-1!==u[link].getAttribute("href").search("#"))&&(!u[link].parentElement.classList.contains("menu-item-has-children")||u[link].parentElement.classList.contains("menu-item-has-children")&&document.querySelector("header.site-header").classList.contains("ast-builder-menu-toggle-icon"))&&m&&(u[link].addEventListener("click",v,!0),u[link].headerType="dropdown")}}for(r=0;r<a.length;r++)a[r].removeEventListener("click",popupTriggerClick,!1),a[r].removeEventListener("click",astraNavMenuToggle),a[r].addEventListener("click",astraNavMenuToggle,!1),a[r].trigger_type="mobile";for(r=0;r<n.length;r++)n[r].removeEventListener("click",popupTriggerClick,!1),n[r].removeEventListener("click",astraNavMenuToggle),n[r].addEventListener("click",astraNavMenuToggle,!1),n[r].trigger_type="desktop";AstraToggleSetup()}}function v(e){switch(e.currentTarget.headerType){case"dropdown":for(var t=document.querySelectorAll(".menu-toggle.toggled"),a=0;a<t.length;a++)t[a].click();break;case"off-canvas":document.getElementById("menu-toggle-close").click()}}""!==(p=null!=g?g.querySelector("#ast-mobile-header"):p)&&null!==p&&(c=p.dataset.type),document.addEventListener("astMobileHeaderTypeChange",e,!1),document.addEventListener("click",function(e){e=e.target.closest(".menu-toggle");if(e&&"dropdown"===c){if("undefined"==typeof astraAddon){e.classList.toggle("toggled");{var a=document.querySelectorAll(".menu-toggle");let t=Array.from(a).every(e=>e.classList.contains("toggled"));a.forEach(e=>{t?(e.classList.remove("toggled"),e.setAttribute("aria-expanded","false")):(e.classList.add("toggled"),e.setAttribute("aria-expanded","true"))})}}a=e.classList.contains("toggled");e.setAttribute("aria-expanded",a?"true":"false")}}),popupTriggerClick=function(e){var t=e.currentTarget.trigger_type,a=document.getElementById("ast-mobile-popup");d.classList.contains("ast-popup-nav-open")||d.classList.add("ast-popup-nav-open"),d.classList.contains("ast-main-header-nav-open")||"mobile"===t||d.classList.add("ast-main-header-nav-open"),document.documentElement.classList.contains("ast-off-canvas-active")||document.documentElement.classList.add("ast-off-canvas-active"),"desktop"===t&&(a.querySelector(".ast-mobile-popup-content").style.display="none",a.querySelector(".ast-desktop-popup-content").style.display="block"),"mobile"===t&&(a.querySelector(".ast-desktop-popup-content").style.display="none",a.querySelector(".ast-mobile-popup-content").style.display="block"),e&&e.currentTarget&&e.currentTarget.style&&(e.currentTarget.style.display="none"),a.classList.add("active","show"),document.getElementById("menu-toggle-close")?.focus()},window.addEventListener("load",function(){t()}),document.addEventListener("astLayoutWidthChanged",function(){t()}),document.addEventListener("astPartialContentRendered",function(){r=document.querySelectorAll(".main-header-menu-toggle"),d.classList.remove("ast-main-header-nav-open"),document.addEventListener("astMobileHeaderTypeChange",e,!1),t()});var s=null!==navigator.userAgent.match(/Android/i)&&"Android"===navigator.userAgent.match(/Android/i)[0]?window.visualVie
4wport.width:window.innerWidth;window.addEventListener("resize",function(){var e,t,a,n;"INPUT"!==document.activeElement.tagName&&(e=document.getElementById("menu-toggle-close"),t=document.querySelector(".menu-toggle.toggled"),a=document.querySelector("#masthead > #ast-desktop-header .ast-desktop-header-content"),n=document.querySelector(".elementor-editor-active"),a&&(a.style.display="none"),(null!==navigator.userAgent.match(/Android/i)&&"Android"===navigator.userAgent.match(/Android/i)[0]?window.visualViewport.width:window.innerWidth)!==s&&(t&&null===n&&t.click(),document.body.classList.remove("ast-main-header-nav-open","ast-popup-nav-open"),e)&&null==n&&e.click(),o(),AstraToggleSetup())}),document.addEventListener("DOMContentLoaded",function(){if(AstraToggleSetup(),null!==(e=d.classList.contains("ast-header-break-point")?document.getElementById("ast-mobile-header"):document.getElementById("ast-desktop-header"))){var e,t=e.querySelector(".navigation-accessibility");if(t&&e){var a=e.getElementsByTagName("button")[0]||e.getElementsByTagName("a")[0];if(a&&!a.classList.contains("astra-search-icon")){var n=t.getElementsByTagName("ul")[0];if(n){if(n.className.includes("nav-menu")||(n.className+=" nav-menu"),document.addEventListener("DOMContentLoaded",function(){var e;"off-canvas"===c&&(e=document.getElementById("menu-toggle-close"))&&(e.onclick=function(){var e=t.className.includes("toggled");t.className=e?t.className.replace(" toggled",""):t.className+" toggled",a.setAttribute("aria-expanded",e?"false":"true"),n.setAttribute("aria-expanded",e?"false":"true")})}),a.onclick=function(){var e=t.className.includes("toggled");t.className=e?t.className.replace(" toggled",""):t.className+" toggled",a.setAttribute("aria-expanded",e?"false":"true"),n.setAttribute("aria-expanded",e?"false":"true")},!astra.is_header_footer_builder_active){for(var s=n.getElementsByTagName("a"),o=n.getElementsByTagName("ul"),r=0,l=o.length;r<l;r++)o[r].parentNode.setAttribute("aria-haspopup","true");for(r=0,l=s.length;r<l;r++)s[r].addEventListener("focus",b,!0),s[r].addEventListener("blur",b,!0),s[r].addEventListener("click",y,!0)}astra.is_header_footer_builder_active&&(()=>{let s=document.querySelectorAll("nav.site-navigation .menu-item-has-children > a .ast-header-navigation-arrow"),o=document.querySelectorAll("nav.site-navigation .sub-menu"),r=document.querySelectorAll("nav.site-navigation .menu-item-has-children"),l=document.querySelectorAll(".astra-full-megamenu-wrapper");s&&(s.forEach(e=>{e.addEventListener("keydown",function(s){if("Enter"===s.key||" "===s.key){/Mobi|Android|iPad|iPhone/i.test(navigator.userAgent)&&(s.preventDefault(),s.stopPropagation());let t=s.target.closest("li"),a=t.querySelector(".sub-menu"),n=a&&a.classList.contains("astra-megamenu");setTimeout(()=>{n?(e=t.querySelector(".astra-full-megamenu-wrapper"),a&&a.classList.toggle("astra-megamenu-focus"),e&&e.classList.toggle("astra-megamenu-wrapper-focus")):a.classList.toggle("toggled-on"),t.classList.toggle("ast-menu-hover");var e=s.target.getAttribute("aria-expanded");s.target.setAttribute("aria-expanded","false"!==e&&e?"false":"true")},10)}}),e.addEventListener("pointerdown",function(e){e.currentTarget.dataset.astPointerType=e.pointerType||"mouse"},!1),e.addEventListener("click",function(e){var t,a,n=e.currentTarget;"touch"===n.dataset.astPointerType&&d.classList.contains("ast-desktop")&&(a=(t=n.closest("li"))&&t.querySelector(".sub-menu"))&&(e.preventDefault(),e.stopPropagation(),e="true"===n.getAttribute("aria-expanded"),f(o,s,r,l),e||(a.classList.add("toggled-on"),t.classList.add("ast-menu-hover"),n.setAttribute("aria-expanded","true")))},!1)}),o||r)&&(document.addEventListener("click",function(e){f(o,s,r,l)},!1),document.addEventListener("keydown",function(e){"Escape"===e.key&&f(o,s,r,l)},!1));var e=document.querySelectorAll("nav.site-navigation .ast-nav-menu > .menu-item-has-children > a .ast-header-navigation-arrow");e&&e.forEach(e=>{e.addEventListener("keydown",function(e){e.target.closest("li").classList.contains("ast-menu-hover")||"Enter"!==e.key||f(o,s,r,l)},!1)}),(e=document.querySelectorAll("#ast-desktop-header .ast-builder
4-layout-element.ast-builder-menu")).forEach(e=>{e.querySelectorAll(".main-header-menu .menu-item > a").forEach(e=>{e.addEventListener("focusout",function(e){var t=e.relatedTarget,a=t?t.closest(".menu-item"):null,t=e.target.closest(".menu-item"),e=t.classList.contains("ast-menu-hover"),n=t.querySelector(".sub-menu"),s=t.closest(".sub-menu"),o=t.closest(".sub-menu")?.closest(".menu-item-has-children"),r=t.querySelector(".menu-item");if(!(t==a||r&&r==a))if(null==a)s&&m(s),n&&m(n);else if(t.nextElementSibling==a||t.previousElementSibling==a)e&&(m(n,!1),t.classList.remove("ast-menu-hover"));else if(o&&o==a)m(childSubMenu=t.querySelector(".sub-menu"),!1);else{let e=o,t=null;for(;null!=e;){if(e.nextElementSibling==a){t=e.querySelector(".sub-menu");break}e=e.closest(".sub-menu")?.closest(".menu-item-has-children")}s&&m(s,!0,t)}})})})})()}else a.classList.contains("custom-logo-link")||(a.style.display="none")}}}});for(var a,n,o=function(){var e=window.innerWidth,t=astra.break_point;if(window.matchMedia("(max-width: "+(parseFloat(t)+.99)+"px)").matches&&0!==e)d.classList.add("ast-header-break-point"),d.classList.remove("ast-desktop"),astraTriggerEvent(d,"astra-header-responsive-disabled");else{if(0<r.length)for(var a=0;a<r.length;a++)null!==r[a]&&r[a].classList.remove("toggled");d.classList.remove("ast-header-break-point"),d.classList.add("ast-desktop"),astraTriggerEvent(d,"astra-header-responsive-enabled")}},l=(o(),d.classList.add("ast-header-loaded"),AstraToggleSubMenu=function(e){e.preventDefault();for(var t=this.parentNode,a=(t.classList.contains("menu-item-has-children")&&document.querySelector("header.site-header").classList.contains("ast-builder-menu-toggle-link")&&e.stopPropagation(),"false"!==e.target.getAttribute("aria-expanded")&&e.target.getAttribute("aria-expanded")?e.target.setAttribute("aria-expanded","false"):e.target.setAttribute("aria-expanded","true"),t.classList.contains("ast-submenu-expanded")&&document.querySelector("header.site-header").classList.contains("ast-builder-menu-toggle-link")&&(this.classList.contains("ast-menu-toggle")||""!==(e=t.querySelector("a").getAttribute("href"))&&"#"!==e&&(window.location=e)),t.querySelectorAll(".menu-item-has-children")),n=0;n<a.length;n++){a[n].classList.remove("ast-submenu-expanded");var s=a[n].querySelector(".sub-menu, .children");null!==s&&(s.style.display="none")}for(var o=t.parentNode.querySelectorAll(".menu-item-has-children"),n=0;n<o.length;n++)if(o[n]!=t){o[n].classList.remove("ast-submenu-expanded");for(var r=o[n].querySelectorAll(".sub-menu"),l=0;l<r.length;l++)r[l].style.display="none"}t.classList.contains("menu-item-has-children")&&(astraToggleClass(t,"ast-submenu-expanded"),t.classList.contains("ast-submenu-expanded")?t.querySelector(".sub-menu").style.display="block":t.querySelector(".sub-menu").style.display="none")},AstraToggleSetup=function(){if("undefined"!=typeof astraAddon&&"function"==typeof astraToggleSetupPro)astraToggleSetupPro(c,d,i);else{var e,t,a,n=!1;if(0<(e="off-canvas"===c||"full-width"===c?(t=document.querySelectorAll("#ast-mobile-popup, #ast-mobile-header"),(a=document.querySelectorAll("#ast-mobile-header .main-header-menu-toggle")).length):(t=document.querySelectorAll("#ast-mobile-header"),(n=!(0<(e=(a=document.querySelectorAll("#ast-mobile-header .main-header-menu-toggle")).length)))?1:e))||n)for(var s=0;s<e;s++)if(n||(a[s].setAttribute("data-index",s),i[s])||(i[s]=a[s],a[s].removeEventListener("click",astraNavMenuToggle),a[s].addEventListener("click",astraNavMenuToggle,!1)),void 0!==t[s])for(var o,r=0;r<t.length;r++)if(0<(o=document.querySelector("header.site-header").classList.contains("ast-builder-menu-toggle-link")?t[r].querySelectorAll("ul.main-header-menu .menu-item-has-children > .menu-link, ul.main-header-menu .ast-menu-toggle"):t[r].querySelectorAll("ul.main-header-menu .ast-menu-toggle")).length)for(var l=0;l<o.length;l++)o[l].removeEventListener("click",AstraToggleSubMenu),o[l].addEventListener("click",AstraToggleSubMenu,!1)}},astraNavMenuToggle=function(e){if("undefined"!=typeof astraAddon)astraNavMenuTogglePro(e,d,c,this);else{e.preventDefault();var e=document.querySelectorAll("#masthead > #ast-mobile-header .main-header-bar-navigation"),t=(r=document.querySelectorAll("#masthead > #ast-mobile-header .main-header-menu-toggle"),"0");if(null!==this.closest("#ast-fixed-header")&&(e=document.querySelectorAll("#ast-fixed-header > #ast-mobile-header .main-header-bar-navigation"),r=document.querySelectorAll("#ast-fixed-header .main-header-menu-toggle"),t="0"),void 0===e[t])return!1;for(var a=e[t].querySelectorAll(".menu-item-has-children"),n=0;n<a.length;n++){a[n].classList.remove("ast-submenu-expanded");for(var s=a[n].querySelectorAll(".sub-menu"),o=0;o<s.length;o++)s[o].style.display="none"}-1!==(this.getAttribute("class")||"").indexOf("main-header-menu-toggle")&&(astraToggleClass(e[t],"toggle-on"),astraToggleClass(r[t],"toggled"),e[t].classList.contains("toggle-on")?(e[t].style.display="block",d.classList.add("ast-main-header-nav-open")):(e[t].style.display="",d.classList.remove("ast-main-header-nav-open")))}},d.addEventListener("astra-header-responsive-enabled",function(){var e=document.querySelectorAll(".main-header-bar-navigation");if(0<e.length)for(var t=0;t<e.length;t++){null!=e[t]&&(e[t].classList.remove("toggle-on"),e[t].style.display="");for(var a=e[t].getElementsByClassName("sub-menu"),n=0;n<a.length;n++)a[n].style.display="";for(var s=e[t].getElementsByClassName("children"),o=0;o<s.length;o++)s[o].style.display="";for(var r=e[t].getElementsByClassName("ast-search-menu-icon"),l=0;l<r.length;l++)r[l].classList.remove("ast-dropdown-active"),r[l].style.display=""}},!1),document.getElementsByClassName("astra-search-icon")),u=0;u<l.length;u++)l[u].onclick=function(e){var t;this.classList.contains("slide-search")&&(e.preventDefault(),(t=this.parentNode.parentNode.parentNode.querySelector(".ast-search-menu-icon")).classList.contains("ast-dropdown-active")?(""!==(t.querySelector(".search-field").value||"")&&t.querySelector(".search-form").submit(),t.classList.remove("ast-dropdown-active")):(t.classList.add("ast-dropdown-active"),t.querySelector(".search-field").setAttribute("autocomplete","off"),setTimeout(function(){t.querySelector(".search-field").focus()},200)))};function m(e,t=!0,a=null){e.classList.remove("toggled-on"),e.classList.remove("astra-megamenu-focus");var n=e.closest(".menu-item-has-children").querySelector(".ast-header-navigation-arrow");
4n&&n.setAttribute("aria-expanded","false"),(t=a?!0:t)&&null!==(n=e.parentElement.closest(".sub-menu"))&&e!==a&&m(n,!0,a)}function f(e,t,a,n){e&&e.forEach(e=>{e.classList.remove("astra-megamenu-focus"),e.classList.remove("toggled-on")}),a&&a.forEach(e=>{e.classList.remove("ast-menu-hover")}),n&&n.forEach(e=>{e.classList.remove("astra-megamenu-wrapper-focus")}),t&&t.forEach(e=>{e.setAttribute("aria-expanded","false")})}function y(){var e=this||"";if(e&&!e.classList.contains("astra-search-icon")&&null===e.closest(".ast-builder-menu")&&-1!==String(e).indexOf("#")){var t=e.parentNode;if(d.classList.contains("ast-header-break-point"))document.querySelector("header.site-header").classList.contains("ast-builder-menu-toggle-link")&&t.classList.contains("menu-item-has-children")||(document.querySelector(".main-header-menu-toggle").classList.remove("toggled"),(t=document.querySelector(".main-header-bar-navigation")).classList.remove("toggle-on"),t.style.display="none",astraTriggerEvent(document.querySelector("body"),"astraMenuHashLinkClicked"));else for(;-1===e.className.indexOf("nav-menu");)"li"===e.tagName.toLowerCase()&&-1!==e.className.indexOf("focus")&&(e.className=e.className.replace(" focus","")),e=e.parentElement}}function b(){for(var e=this;-1===e.className.indexOf("navigation-accessibility");)"li"===e.tagName.toLowerCase()&&e.classList.toggle("focus"),e=e.parentElement}if(document.querySelectorAll(".search-field").forEach(e=>{e.addEventListener("focus",function(e){var t=this.parentNode.parentNode.parentNode.querySelector(".ast-search-menu-icon");t&&astraToggleClass(t,"ast-dropdown-active")}),e.addEventListener("blur",function(e){var t=this.parentNode.parentNode.parentNode.querySelector(".ast-search-menu-icon");t&&(t.classList.remove("ast-dropdown-active"),astraToggleClass(t,"ast-dropdown-active"))})}),d.onclick=function(e){if(void 0!==e.target.classList&&!e.target.classList.contains("ast-search-menu-icon")&&!e.target.closest(".ast-search-menu-icon")&&!e.target.closest(".ast-search-icon"))for(var t=document.getElementsByClassName("ast-search-menu-icon"),a=0;a<t.length;a++)t[a].classList.remove("ast-dropdown-active")},astra.is_header_footer_builder_active||"querySelector"in document&&"addEventListener"in window&&(d.addEventListener("mousedown",function(){d.classList.add("ast-mouse-clicked")}),d.addEventListener("keydown",function(){d.classList.remove("ast-mouse-clicked")})),astra.is_scroll_to_id){let o=e=>{let t=0;for(;e;)t+=e.offsetTop,e=e.offsetParent;return t},t=(e,t=null)=>{let a=0;var n,s=document.querySelector(".site-header");s&&(0<(s=s.querySelectorAll("div[data-stick-support]")).length?s.forEach(e=>a+=e.clientHeight):"undefined"==typeof astraAddon||Number(astraAddon.sticky_hide_on_scroll)&&!document?.querySelector(".ast-header-sticked")||(s=document.querySelector("#ast-fixed-header"))&&(a=s?.clientHeight,Number(astraAddon?.header_main_shrink))&&(s?.querySelectorAll(".ast-above-header-wrap, .ast-below-header-wrap"))?.forEach(()=>a-=10),s=t||e.target?.closest("a").hash)&&(n=document.querySelector(s))&&(n=(n=o(n))-(a="undefined"!=typeof astraAddon&&Number(astraAddon.sticky_hide_on_scroll)&&window?.scrollY<n?0:a))&&(astraSmoothScroll(e,n),t||s===window.location.hash||window.history.pushState(null,"",s))},s=[];var L=document.querySelectorAll('a[href*="#"]:not([href="#"]):not([href="#0"]):not([href*="uagb-tab"]):not(.uagb-toc-link__trigger):not(.skip-link):not(.nav-links a):not([href*="tab-"])');if(L)for(let e of L)e.href.split("#")[0]!==location.href.split("#")[0]?s.push({hash:e.hash,url:e.href.split("#")[0]}):""!==e.hash&&e.addEventListener("click",t);window.addEventListener("DOMContentLoaded",e=>{for(var a of s)if(window.location.href.split("#")[0]===a.url){var n=document.querySelector(".site-header");let t=0;n=n.querySelectorAll("div[data-stick-support]"),n=(n&&n.forEach(e=>{t+=e.clientHeight}),document.querySelector(a.hash));n&&(a=o(n)-t)&&astraSmoothScroll(e,a)}location.hash&&setTimeout(()=>t(new Event("click"),location.hash),750)})}astra.is_scroll_to_top&&(a=document.querySelector("#page header"),n=document.getElementById("ast-scroll-top"),astScrollToTopHandler(a,n),window.addEventListener("scroll",function(){astScrollToTopHandler(a,n)}),n.onclick=function(e){astraSmoothScroll(e,0)},n.addEventListener("keydown",function(e){"Enter"===e.key&&astraSmoothScroll(e,0)}
4)),astra?.is_dark_palette?document.documentElement.classList.add("astra-dark-mode-enable"):document.documentElement.classList.remove("astra-dark-mode-enable"),window.addEventListener("DOMContentLoaded",e=>{var t=document.querySelector(".ast-woocommerce-store-notice-hanged");let a=()=>{var e=document.querySelector('.woocommerce-store-notice[data-position="hang-over-top"]');document.body.style.paddingTop=`${e?.clientHeight||0}px`};t&&(window.addEventListener("resize",a),setTimeout(()=>a(),0)),document.querySelector(".woocommerce-store-notice__dismiss-link")?.addEventListener("click",()=>{"undefined"!=typeof wp&&wp?.customize||(document.body.classList.remove("ast-woocommerce-store-notice-hanged"),window.removeEventListener("resize",a),document.body.style.paddingTop=0)})})})(),document.addEventListener("DOMContentLoaded",function(){let t=document.querySelectorAll(".menu-link .dropdown-menu-toggle");function n(e){var e=e.closest(".menu-link"),t=e.nextElementSibling.classList.contains("toggled-on");e.setAttribute("aria-expanded",t?"true":"false")}document.querySelectorAll(".menu-item-has-children > a").forEach(t=>{t.addEventListener("keydown",function(e){"Enter"===e.key&&(e=t.nextElementSibling)&&e.classList.contains("sub-menu")&&(e.classList.toggle("ast-visible"),e="false"===t.getAttribute("aria-expanded")?"true":"false",t.setAttribute("aria-expanded",e))})}),t.forEach(a=>{a.addEventListener("focus",()=>n(a)),a.addEventListener("blur",()=>n(a)),a.addEventListener("keydown",e=>{var t;"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e=(e=a).closest(".menu-link"),t=e.getAttribute("aria-expanded"),e.setAttribute("aria-expanded","true"===t?"false":"true"))})}),document.addEventListener("keydown",e=>{"Escape"===e.key&&t.forEach(e=>n(e))}),window.addEventListener("orientationchange",()=>{setTimeout(()=>window.dispatchEvent(new Event("resize")),50)})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(".astra-shop-thumbnail-wrap").forEach(t=>{let a=t.querySelectorAll("a, span");a.forEach(e=>{e.addEventListener("focus",()=>{t.querySelectorAll(".ast-on-card-button, .ast-quick-view-trigger").forEach(e=>{e.style.opacity="1",e.style.visibility="visible",e.style.borderStyle="none"})}),e.addEventListener("blur",()=>{Array.from(a).some(e=>e===document.activeElement)||t.querySelectorAll(".ast-on-card-button, .ast-quick-view-trigger").forEach(e=>{e.style.opacity="",e.style.visibility=""})})})})}); 5 6 7 8} 9catch(e){console.error("WP-Optimize Minify: An error has occurred in the minified code. \n\n- Original script: https://www.inia.gob.ve/wp-content/themes/astra/assets/js/minified/frontend.min.js\n- Error message: "+ e.message);} 10 11(function($){("use strict");$(document).ready(function(){initYouTubeGallery()});function initYouTubeGallery(){function parseMaybeJSON(val,fallback){if(typeof val==="string"){try{return JSON.parse(val)}catch(e){return fallback}} 12return typeof val==="object"&&val!==null?val:fallback} 13function truncateText(text,length){if(!text)return"";const width=$(window).width();let maxLength;if(width<600){maxLength=length.sm||length.lg}else if(width<900){maxLength=length.md||length.lg}else{maxLength=length.lg} 14return text.length>maxLength?text.substring(0,maxLength)+"...":text} 15function sortVideos(videos,sortBy){const sorted=[...videos];switch(sortBy){case "title":return sorted.sort((a,b)=>a.title.localeCompare(b.title,undefined,{sensitivity:"base",}));case "latest":return sorted.sort((a,b)=>new Date(b.publishedAt).getTime()-new Date(a.publishedAt).getTime());case "date":return sorted.sort((a,b)=>new Date(a.publishedAt).getTime()-new Date(b.publishedAt).getTime());case "popular":return sorted.sort((a,b)=>(b.viewCount||0)-(a.viewCount||0));default:return videos}} 16function getPlaylistId(input){if(!input)return"";try{const url=new URL(input);if(url.hostname==="www.youtube.com"){if(url.pathname.startsWith("/channel/")){return url.pathname.split("/channel/")[1]}else if(url.pathname.startsWith("/@")){return url.pathname.substring(2)}else if(url.searchParams.get("list")){return url.searchParams.get("list")}} 17return input}catch(e){return input}} 18function resolveHandleToChannelId(handle,apiKey,callback){$.get(`https://www.googleapis.com/youtube/v3/search?part=snippet&q=${encodeURIComponent( 19 handle 20 )}&type=channel&key=${apiKey}`).done(function(data){if(data.items&&data.items.length>0){callback(data.items[0].snippet.channelId)}else{callback(null)}}).fail(function(){callback(null)})} 21function generatePlayerIframe(videoId,config){const params=[`autoplay=${config.auto
21play ? "1" : "0"}`,`loop=${config.loop ? "1" : "0"}`,`mute=${config.mute ? "1" : "0"}`,`controls=${config.showPlayerControl ? "1" : "0"}`,`modestbranding=${config.hideYoutubeLogo ? "1" : "0"}`,config.loop?`playlist=${videoId}`:null,].filter(Boolean).join("&");return ` 22 <div class="ultp-ytg-video-wrapper"> 23 <iframe 24 src="https://www.youtube.com/embed/${videoId}?${params}" 25 title="YouTube Video" 26 frameborder="0" 27 allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" 28 allowfullscreen 29 ></iframe> 30 </div> 31 `} 32function getYoutubeTextContent(enableTitle,title,titleLength,enableDesc,description,descriptionLength,videoId){let html='<div class="ultp-ytg-content">';if(enableTitle){html+=`<div class="ultp-ytg-title"><a href="https://www.youtube.com/watch?v=${videoId}" target="_blank" rel="noopener noreferrer">${truncateText( 33 title, 34 titleLength 35 )}</a></div>`} 36if(enableDesc){html+=`<div class="ultp-ytg-description">${truncateText( 37 description, 38 descriptionLength 39 )}</div>`} 40html+="</div>";return html} 41$(".wp-block-ultimate-post-youtube-gallery").each(function(){const $block=$(this);const $wrapper=$block.find(".ultp-block-wrapper");let $container=$block.find(".ultp-ytg-view-grid, .ultp-ytg-container");const $loadMoreBtn=$block.find(".ultp-ytg-loadmore-btn");const config={playlistIdOrUrl:$block.data("playlist")||"",apiKey:$block.data("api-key")||"",cacheDuration:parseInt($block.data("cache-duration"))||0,sortBy:$block.data("sort-by")||"date",galleryLayout:$block.data("gallery-layout")||"grid",videosPerPage:parseMaybeJSON($block.data("videos-per-page"),{lg:9,md:6,sm:3,}),showVideoTitle:$block.data("show-video-title")=="1",videoTitleLength:parseMaybeJSON($block.data("video-title-length"),{lg:50,md:50,sm:50,}
41),loadMoreEnable:$block.data("load-more-enable")=="1",moreButtonLabel:$block.data("more-button-label")||"More Videos",autoplay:$block.data("autoplay")=="1",loop:$block.data("loop")=="1",mute:$block.data("mute")=="1",showPlayerControl:$block.data("show-player-control")=="1",hideYoutubeLogo:$block.data("hide-youtube-logo")=="1",showDescription:$block.data("show-description")=="1",videoDescriptionLength:parseMaybeJSON($block.data("video-description-length"),{lg:100,md:100,sm:100,}),imageHeightRatio:$block.data("image-height-ratio")||"16-9",galleryColumn:parseMaybeJSON($block.data("gallery-column"),{lg:3,md:2,sm:1,}),displayType:$block.data("display-type")||"grid",enableListView:$block.data("enable-list-view")=="1",enableIconAnimation:$block.data("enable-icon-animation")=="1",defaultYoutubeIcon:$block.data("enable-youtube-icon")=="1",imgHeight:$block.data("img-height"),};let playlistId=getPlaylistId(config.playlistIdOrUrl);if(playlistId.startsWith("@")){const handle=playlistId.substring(1);resolveHandleToChannelId(handle,config.apiKey,function(channelId){if(channelId){playlistId=channelId;proceedWithPlaylist(playlistId)}else{$wrapper.html('<p style="color:#888">Invalid handle or API key.</p>')}})}else{proceedWithPlaylist(playlistId)} 42function proceedWithPlaylist(playlistId){if(playlistId.startsWith("UC")){playlistId="UU"+playlistId.substring(2)} 43if(!playlistId||!config.apiKey){$wrapper.html('<p style="color:#888">Please provide both YouTube playlist ID/URL and API key.</p>');return} 44let allVideos=[];let shownCount=config.videosPerPage.lg||9;let activeVideo=null;let playingId=null;function updateResponsiveCounts(){const width=$(window).width();if(width<600){shownCount=Math.max(shownCount,config.videosPerPage.sm||3)}else if(width<900){shownCount=Math.max(shownCount,config.videosPerPage.md||6)}else{shownCount=Math.max(shownCount,config.videosPerPage.lg||9)}} 45function renderPlaylistLayout(videos){if(!videos.length){$container.html("<p>No videos found in this playlist.</p>");return} 46if(!activeVideo){activeVideo=videos[0]} 47let html='<div class="ultp-ytg-main">';const playerWrapper=` 48 <div class="ultp-ytg-video-wrapper"> 49 <iframe 50 src="https://www.youtube.com/embed/${activeVideo.videoId}?${[ 51 `autoplay=${config.autoplay?"1":"0"}`, 52 `loop=${config.loop?"1":"0"}`, 53 `mute=${config.mute?"1":"0"}`, 54 `controls=${config.showPlayerControl?"1":"0"}`, 55 `modestbranding=${config.hideYoutubeLogo?"1":"0"}`, 56 config.loop ? `playlist=${activeVideo.videoId}` : null, 57 ] 58 .filter(Boolean) 59 .join("&")}" 60 title="YouTube Video" 61 frameborder="0" 62 allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" 63 allowfullscreen 64 ></iframe> 65 ${getYoutubeTextContent( 66 config.showVideoTitle, 67 activeVideo.title, 68 config.videoTitleLength, 69 config.showDescription, 70 activeVideo.description, 71 config.videoDescriptionLength, 72 activeVideo.videoId 73 )} 74 </div> 75 `;html+=playerWrapper;html+="</div>";html+='<div class="ultp-ytg-playlist-sidebar">';html+='<div class="ultp-ytg-playlist-items">';videos.forEach(function(video){const isActive=video.videoId===activeVideo.videoId;html+=` 76 <div class="ultp-ytg-playlist-item ${ 77 isActive ? "active" : "" 78 }" data-video-id="${video.videoId}"> 79 <img src="${video.thumbnail}" alt="${video.title}" loading="lazy" /> 80 <div class="ultp-ytg-playlist-item-content"> 81 <div class="ultp-ytg-playlist-item-title"> 82 ${truncateText(video.title, config.videoTitleLength)} 83 </div> 84 </div> 85 </div> 86 `});html+="</div></div>";$container.html(html)} 87function renderGridLayout(videos,count){if(!videos.length){$container.html("<p>No videos found in this playlist.</p>");return} 88const displayedVideos=videos.slice(0,count);let html="";displayedVideos.forEach(function(video){const isPlaying=playingId===video.videoId;html+=`<div class="ultp-ytg-item${isPlaying ? " active" : ""}">`;html+=`<div class="ultp-ytg-video">`;if(isPlaying){html+=generatePlayerIframe(video.videoId,config)}else{const getSvgIcon=$(".ultp-ytg-play__icon").html();html+=` 89 <img src="${video.thumbnail}" alt="${ 90 video.title 91 }" loading="lazy" data-video-id="${ 92 video.videoId 93 }" style="cursor:pointer;" /> 94 <div class="ultp-ytg-play__icon${ 95 config.enableIconAnimation ? " ytg-icon-animation" : "" 96 }"> 97 ${getSvgIcon} 98 </div> 99 `} 100html+=`</div>`;html+=`<div class="ultp-ytg-inside">`;html+=getYoutubeTextContent(config.showVideoTitle,video.title,config.videoTitleLength,config.showDescription,video.description,config.videoDescriptionLength,video.videoId);html+=`</div></div>`});$container.html(html);if(config.loadMoreEnable&&count<videos.length){$loadMoreBtn.show()}else{$loadMoreBtn.hide()}} 101function renderVideos(videos,count){if(config.galleryLayout==="playlist"){renderPlaylistLayout(videos)}else{renderGridLayout(videos,count)}} 102const cacheKey=`ultp_youtube_gallery_${playlistId}_${config.apiKey}_${config.sortBy}_${config.imgHeight}`;const duration=config.cacheDuration;let cached=null;try{cached=JSON.parse(localStorage.getItem(cacheKey))}catch(e){cached=null} 103const now=Date.now();if(cached&&cached.data&&cached.timestamp&&duration>0&&now-cached.timestamp<duration*1000){allVideos=sortVideos(cached.data,config.sortBy);renderVideos(allVideos,shownCount)}else{if(config.galleryLayout!=="playlist"){$container.html(` 104 <div class="ultp-ytg-loading gallery-postx gallery-active"> 105 <div class="skeleton-box"></div> 106 <div class="skeleton-box"></div> 107 <div class="skeleton-box"></div> 108 <div class="skeleton-box"></div> 109 <div class="skeleton-box"></div> 110 <div class="skeleton-box"></div> 111 </div> 112 `)}else{$container.html(` 113 <div class="ultp-ytg-loading ultp-ytg-playlist-loading"> 114 <div class="ytg-loader"></div> 115 </div>`)} 116$.get("https://www.googleapis.com/youtube/v3/playlistItems",{part:"snippet",maxResults:50,playlistId:playlistId,key:config.apiKey,}).done(function(data){setTimeout(function(){$container.empty();if(data.error){$container.html(`<div class="ultp-ytg-error">${ 117 data.error.message || "Failed to fetch playlist." 118 }</div>`);return} 119const videos=(data.items||[]).filter(function(item){return(item.snippet.title!=="Private video"&&item.snippet.title!=="Deleted video")}).map(function(item){return{videoId:item.snippet.resourceId.videoId,title:item.snippet.title,thumbnail:(item.snippet.thumbnails&&item.snippet.thumbnails[config.imgHeight]&&item.snippet.thumbnails[config.imgHeight].url)||item.snippet.thumbnails[config.imgHeight].url||item.snippet.thumbnails?.medium?.url||"",publishedAt:item.snippet.publishedAt||"",description:item.snippet.description||"",viewCount:0,}});if(config.sortBy==="popular"){const videoIds=videos.map((v)=>v.videoId).join(",");$.get(`https://www.googleapis.com/youtube/v3/videos?part=statistics&id=${videoIds}&key=${config.apiKey}`).done(function(statsData){if(statsData.items){const statsMap={};
119statsData.items.forEach(function(item){statsMap[item.id]=item.statistics.viewCount});videos.forEach(function(v){v.viewCount=parseInt(statsMap[v.videoId]||0)})} 120allVideos=sortVideos(videos,config.sortBy);if(duration>0){try{localStorage.setItem(cacheKey,JSON.stringify({data:videos,timestamp:now,}))}catch(e){console.warn("Failed to cache videos:",e)}} 121renderVideos(allVideos,shownCount)}).fail(function(){console.warn("Failed to fetch video statistics for popular sorting.");allVideos=sortVideos(videos,config.sortBy);renderVideos(allVideos,shownCount)})}else{allVideos=sortVideos(videos,config.sortBy);if(duration>0){try{localStorage.setItem(cacheKey,JSON.stringify({data:videos,timestamp:now,}))}catch(e){console.warn("Failed to cache videos:",e)}} 122renderVideos(allVideos,shownCount)}},2000)}).fail(function(){setTimeout(function(){$container.empty();$container.html('<div class="ultp-ytg-error">Failed to fetch videos. Please try again.</div>')},3000)})} 123$block.on("click",".ultp-ytg-playlist-item",function(){const videoId=$(this).data("video-id");if(!videoId)return;activeVideo=allVideos.find(function(v){return v.videoId===videoId});if(activeVideo){renderPlaylistLayout(allVideos)}});$block.on("click",".ultp-ytg-play__icon",function(){const $img=$(this).siblings("img[data-video-id]");const videoId=$img.data("video-id");if(!videoId)return;const $item=$(this).closest(".ultp-ytg-item");const $videoDiv=$item.find(".ultp-ytg-video");$videoDiv.html('<div class="ultp-ytg-loading"><div class="ytg-loader"></div></div>');$item.addClass("active").siblings(".ultp-ytg-item").removeClass("active");setTimeout(function(){playingId=videoId;renderGridLayout(allVideos,shownCount)},1000)});$block.on("click",".ultp-ytg-video img[data-video-id]",function(){const videoId=$(this).data("video-id");if(!videoId)return;playingId=videoId;renderGridLayout(allVideos,shownCount)});$loadMoreBtn.on("click",function(){shownCount+=config.videosPerPage.lg;renderGridLayout(allVideos,shownCount)});$(window).on("resize",function(){if(allVideos.length){updateResponsiveCounts();renderVideos(allVideos,shownCount)}})}})}})(jQuery); 124 125 126 127} 128catch(e){console.error("WP-Optimize Minify: An error has occurred in the minified code. \n\n- Original script: https://www.inia.gob.ve/wp-content/plugins/ultimate-post/assets/js/ultp-youtube-gallery-block.js\n- Error message: "+ e.message);}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.