(function(){"use strict";/**
* @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/if(!Joomla)throw new Error("Joomla API is not initialized");var L=function(){var a;return document.cookie.length&&((a=document.cookie.split("; ").find(function(t){return t.startsWith("atumSidebarState=")}))==null?void 0:a.split("=")[1])},w=window.matchMedia("(max-width: 992px)"),d=window.matchMedia("(max-width: 575.98px)"),C=window.matchMedia("(min-width: 576px) and (max-width:991.98px)"),b=document.querySelector(".sidebar-menu"),f=[].slice.call(document.querySelectorAll(".sidebar-nav")),o=document.querySelector("#subhead-container"),g=document.querySelector(".wrapper"),i=document.querySelector(".sidebar-wrapper"),u=document.querySelector(".logo"),E=document.querySelector("body.com_login"),r=document.getElementById("menu-collapse-icon"),S=document.querySelectorAll('.nav-item.dropdown span[class*="icon-angle-"]'),y=document.querySelector("#header .header-title"),A=document.querySelector("#header .header-items"),c=[].slice.call(A.children).filter(function(e){return e.classList.contains("header-item")}),s=document.getElementById("header-more-items"),I=[].slice.call(s.querySelectorAll(".header-dd-item")),h=y.getBoundingClientRect().width,m=c.map(function(e){return e.getBoundingClientRect().width});s.classList.remove("d-none"),s.paddingTop;var k=s.getBoundingClientRect().width;s.classList.add("d-none");function l(e){if(!(!u||E)){if(d.matches){u.classList.add("small");return}var a=e||L();a==="closed"?u.classList.add("small"):u.classList.remove("small"),r&&(g.classList.contains("closed")?(r.classList.add("icon-toggle-on"),r.classList.remove("icon-toggle-off")):(r.classList.remove("icon-toggle-on"),r.classList.add("icon-toggle-off")))}}function v(e){var a=e?"icon-angle-up":"icon-angle-down",t=e?"icon-angle-down":"icon-angle-up";S&&S.forEach(function(n){n.classList.remove(a),n.classList.add(t)})}var q=function(a){return a.reduce(function(t,n){return Number(t)+Number(n)},0)};function p(){h=y.getBoundingClientRect().width;var e=h+k,a=50+q(m);h+a<document.body.getBoundingClientRect().width?(c.map(function(t){return t.classList.remove("d-none")}),s.classList.add("d-none")):(s.classList.remove("d-none"),I.map(function(t){return t.classList.add("d-none")}),s.classList.remove("d-none"),m.forEach(function(t,n){var x=m.slice(n,m.length);e+q(x)<document.body.getBoundingClientRect().width||c[n].children&&!c[n].children[0].classList.contains("dropdown")&&(c[n].classList.add("d-none"),I[n].classList.remove("d-none"))}))}function B(){d.matches?(v(),b&&g.classList.remove("closed")):v("top"),C.matches&&b&&g.classList.add("closed"),d.matches?(f.map(function(e){return e.classList.add("collapse")}),o&&o.classList.add("collapse"),i&&i.classList.add("collapse")):(f.map(function(e){return e.classList.remove("collapse")}),o&&o.classList.remove("collapse"),i&&i.classList.remove("collapse")),l("closed")}function R(){i?(l(L()||"open"),i.classList.remove("collapse")):l("closed"),f.map(function(e){return e.classList.remove("collapse")}),o&&o.classList.remove("collapse"),v("top")}function W(){window.addEventListener("resize",function(){w.matches?B():R(),p()})}function M(){o&&document.addEventListener("scroll",function(){window.scrollY>0?o.classList.add("shadow-sm"):o.classList.remove("shadow-sm")})}p(),W(),M(),d.matches&&(l("closed"),o&&(o.classList.remove("show"),o.classList.add("collapse"))),navigator.cookieEnabled||Joomla.renderMessages({error:[Joomla.Text._("JGLOBAL_WARNCOOKIES")]},void 0,!1,6e3),window.addEventListener("joomla:menu-toggle",function(e){p(),document.cookie="atumSidebarState="+e.detail+";",w.matches?l("closed"):l(e.detail)}),document.querySelectorAll('[data-bs-toggle="dropdown"]').forEach(function(e){e.addEventListener("click",function(){document.querySelectorAll('[data-bs-toggle="collapse"]').forEach(function(a){var t=document.querySelector(a.getAttribute("data-bs-target")),n=bootstrap.Collapse.getInstance(t)||new bootstrap.Collapse(t,{toggle:!1});n.hide()})})})})();