function t_menuBase__highlightActiveLinks(e){var t=window.location.href,n,r=window.location.pathname;"/"===t[t.length-1]&&(n=t.slice(0,-1)),"/"===r[r.length-1]&&(r=r.slice(0,-1)),"/"===r[0]&&(r=r.slice(1)),""===r&&(r="/");var i=document.querySelectorAll(e);Array.prototype.forEach.call(i,(function(e){var i=e.getAttribute("href");if(i){var o=e.href,a="/"===i[0]?i.slice(1):i,s;-1!==r.indexOf("tpost")&&(s="/"+r.slice(0,r.indexOf("tpost"))),o!==t&&o!==r&&i!==t&&i!==r&&a!==r&&n!==t&&n!==r&&i!==s||e.classList.add("t-active")}}))}function t_menuBase__findAnchorLinks(e,t){var n=document.getElementById("rec"+e);if(n&&t_menuBase__isBlockVisible(n)){var r=t+'[href*="#"]:not(.tooltipstered)',i=n?n.querySelectorAll(r):[];i.length&&t_menuBase__updateActiveLinks(i,t)}}function t_menuBase__updateActiveLinks(e,t){var n=t.slice(2);n=".t"+(n=parseInt(n,10)),e=Array.prototype.slice.call(e);var r=null,i=[],o={};(e=e.reverse()).forEach((function(e){var t=t_menuBase__getSectionByHref(e);t&&t.id&&(i.push(t),o[t.id]=e)})),t_menuBase__updateSectionsOffsets(i),i.sort((function(e,t){var n=parseInt(e.getAttribute("data-offset-top"),10)||0,r;return(parseInt(t.getAttribute("data-offset-top"),10)||0)-n})),window.addEventListener("resize",t_throttle((function(){t_menuBase__updateSectionsOffsets(i)}),200));var a=document.querySelectorAll(n);Array.prototype.forEach.call(a,(function(e){e.addEventListener("displayChanged",(function(){t_menuBase__updateSectionsOffsets(i)}))})),t_menuBase__highlightNavLinks(e,i,o,r),e.forEach((function(t,n){t.addEventListener("click",(function(){var i=t_menuBase__getSectionByHref(t);!t.classList.contains("tooltipstered")&&i&&i.id&&(e.forEach((function(e,t){t===n?e.classList.add("t-active"):e.classList.remove("t-active")})),r=i.id)}))})),window.addEventListener("scroll",t_throttle((function(){r=t_menuBase__highlightNavLinks(e,i,o,r)}),100)),"ResizeObserver"in window&&setTimeout((function(){var e;new ResizeObserver((function(){t_menuBase__updateSectionsOffsets(i)})).observe(document.body)}),500)}function t_menuBase__updateSectionsOffsets(e){e.forEach((function(e){var t=e.getBoundingClientRect().top+window.pageYOffset;e.getAttribute("data-offset-top")!==t.toString()&&e.setAttribute("data-offset-top",t)}))}function t_menuBase__getSectionByHref(e){if(e){var t=e.getAttribute("href"),n=t?t.replace(/\s+/g,""):"";if(0===n.indexOf("/")&&(n=n.slice(1)),t&&e.matches('[href*="#rec"]'))return n=n.replace(/.*#/,""),document.getElementById(n);var r=t?t.trim():"",i=-1!==r.indexOf("#")&&r.indexOf("#");("number"==typeof i||"number"==typeof(i=-1!==r.indexOf("/")&&r.indexOf("/")))&&(r=r.slice(i+1));var o='a[name="'+r+'"]',a=document.querySelector(o);if(a){var s=a.closest('.r[data-record-type="215"], .r[data-parenttplid="215"]');if(s)return s;var l=document.querySelector(o+"+ .r");return l?(a.id=l?l.id+"_"+r:"",a):null}}}function t_menuBase__highlightNavLinks(e,t,n,r){if(document.documentElement.classList.contains("t-body_scroll-locked"))return null;var i=window.pageYOffset,o=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight),a=r,s=t.length?t[t.length-1]:null,l=s&&parseInt(s.getAttribute("data-offset-top"),10)||0;if(t.length&&null===r&&l>i+300)return e.forEach((function(e){e.classList.remove("t-active")})),null;for(var u=0;u=c||0===u&&i>=o-window.innerHeight){null===r&&d&&!d.classList.contains("t-active")?(e.forEach((function(e){e.classList.remove("t-active")})),d&&d.classList.add("t-active"),a=null):null!==r&&t[u].id&&r===t[u].id&&(a=null);break}}return a}function t_menuBase__setBGcolor(e,t){var n=document.querySelectorAll(t);Array.prototype.forEach.call(n,(function(e){window.innerWidth>960?"yes"===e.getAttribute("data-bgcolor-setbyscript")&&(e.style.backgroundColor=e.getAttribute("data-bgcolor-rgba")):(e.style.backgroundColor=e.getAttribute("data-bgcolor-hex"),e.setAttribute("data-bgcolor-setbyscript","yes"),e.style.transform&&(e.style.transform=""),e.style.opacity&&(e.style.opacity=""))}))}function t_menuBase__showFixedMenu(e,t){var n,r=[".t280",".t282",".t450",".t451",".t466",".t453"].some((function(e){return e===t})),i=document.getElementById("rec"+e);if(i){var o=".t-menu-popover"===t;if(o||!(window.innerWidth<=960)||r){var a=i.querySelectorAll(t);Array.prototype.forEach.call(a,(function(e){var t=e.getAttribute("data-appearoffset");if(t){-1!==t.indexOf("vh")&&(t=Math.floor(window.innerHeight*(parseInt(t)/100))),t=parseInt(t,10);var n=e.clientHeight;if("number"==typeof t&&window.pageYOffset>=t)e.style.transform==="translateY(-"+n+"px)"&&t_menuBase__slideElement(e,n,"toBottom");else if("translateY(0px)"===e.style.transform||"visible"===e.dataset.slideState){if(t_menuBase__slideElement(e,n,"toTop"),o){var r=i.querySelector(".t-menu-popover__burgermenu");if(!r.classList.contains("t-menu-popover__burgermenu__dropdown"))return;t1362_closeMenu(i,r,void 0)}}else e.style.transform="translateY(-"+n+"px)",e.style.opacity="0"}}))}}}function t_menuBase__changeBgOpacity(e,t){var n,r=["t280","t282","t451","t466","t1362"].some((function(e){return-1!==t.indexOf(e)}));if(!(window.innerWidth<=960)||r){var i=document.getElementById("rec"+e);if(!i)return!1;var o=i.querySelectorAll(t);Array.prototype.forEach.call(o,(function(e){var t=e.getAttribute("data-bgcolor-rgba"),n=e.getAttribute("data-bgcolor-rgba-afterscroll"),r=e.getAttribute("data-bgopacity"),i=e.getAttribute("data-bgopacity-two"),o=parseInt(e.getAttribute("data-menushadow"),10)||0;o/=100;var a=e.getAttribute("data-menushadow-css");e.style.backgroundColor=window.pageYOffset>20?n:t,window.pageYOffset>20&&"0"===i||window.pageYOffset<=20&&("0.0"===r||"0"===r)||!o&&!a?e.style.boxShadow="none":a?e.style.boxShadow=a:o&&(e.style.boxShadow="0px 1px 3px rgba(0,0,0,"+o+")")}))}}function t_menuBase__createMobileMenu(e,t){var n=document.getElementById("rec"+e);if(n){var r=n.querySelector(t),i=r?r.getAttribute("data-mobile-burgerhook"):"",o=n.querySelector(".tmenu-mobile"),a="tmenu-mobile_opened",s="t-menuburger-opened";if(o)if(r&&r.classList.contains(t.slice(1)+"__mobile_burgerhook")&&i){var l;if(o.querySelector(".tmenu-mobile__burger")?l=o.querySelector(".tmenu-mobile__burger"):o.querySelector(".t-menuburger")&&(l=o.querySelector(".t-menuburger")),l){var u=l.parentElement,c=document.createElement("a");c.href=i,u&&(c.appendChild(l),u.appendChild(c))}}else{var d=document.querySelector(".t-records").getAttribute("data-tilda-mode"),f=o.querySelector(".t-menuburger");o.addEventListener("click",(function(n){if(!n.target.closest("a")){if(o.classList.contains(a))t_menuBase__FadeOut(r,300),o.classList.remove(a),f.classList.remove(s),f.classList.remove("t-menu-burger_open"),f.setAttribute("aria-expanded","false"),"edit"===d&&document.body.classList.remove("t-menu-base_opened");else{if(t_menuBase__fadeIn(r,300,(function(){r.style.transform&&(r.style.transform=""),r.style.opacity&&(r.style.opacity="")})),o.classList.add(a),f.classList.add(s),f.classList.add("t-menu-burger_open"),f.setAttribute("aria-expanded","true"),r.classList.contains("tmenu-mobile__menucontent_fixed")){var i=getComputedStyle(o).height,l=getComputedStyle(o).borderBottom||0;r.style.top=i+l}"edit"===d&&document.body.classList.add("t-menu-base_opened")}t_menuBase__checkOverflow(e,t)}}))}screen.width<960&&n.addEventListener("click",(function(n){var i;if(r&&r.classList.contains("tmenu-mobile__menucontent_fixed")){var l=null==(i=r.closest(".r"))?void 0:i.querySelector(".tmenu-mobile_positionfixed"),u=(null==l?void 0:l.offsetHeight)||0;u&&(r.style.top=u+"px");var c=n.target.closest(".t-menu__link-item, .t978__submenu-link, .t978__innermenu-link, .t966__menu-link, .t-menusub__link-item, .t-btn, .t794__link"),d,m;if(c)["t978__menu-link_hook","t978__tm-link","t966__tm-link","t794__tm-link","t-menusub__target-link"].some((function(e){return c.classList.contains(e)}))?r.addEventListener("menuOverflow",(function(){t_menuBase__checkOverflow(e,t)})):(t_menuBase__FadeOut(r,300),o&&o.classList.remove(a),o&&f.classList.remove(s),o&&f.classList.remove("t-menu-burger_open"))}})),window.addEventListener("resize",t_throttle((function(){if(window.innerWidth>960){if(r&&(r.style.opacity=""),r&&(r.style.display=""),r){var n=r.getAttribute("data-top")||"";r.style.top=n}o&&o.classList.remove(a)}t_menuBase__checkOverflow(e,t)}),200)),m(n),window.addEventListener("resize",t_throttle((function(){m(n)}),200))}function m(e){var t=e.querySelector(".tmenu-mobile.tmenu-mobile_positionfixed"),n=e.querySelector(".tmenu-mobile__menucontent_fixed");if(t&&n)if(window.innerWidth<=960){var r=window.getComputedStyle(t),i=64,o,a,s=(parseFloat(r.height)||i)+(parseFloat(r.borderBottomWidth)||0);n.style.setProperty("top",s+"px","important")}else n.style.setProperty("top","0px")}}function t_menuBase__checkOverflow(e,t){var n=document.getElementById("rec"+e),r=n?n.querySelector(t):null;if(r){var i=n.querySelector(t+"__mobile"),o=i||n.querySelector(".tmenu-mobile");if(o){var a=o.offsetHeight,s=document.documentElement.clientHeight,l=r.style.position||window.getComputedStyle(r).position,u=r.offsetHeight;if("fixed"===l&&u>s-a){var c=s-2*a;r.style.overflow="auto",r.style.maxHeight=c+"px"}}}}function t_menuBase__FadeOut(e,t,n){if(!e)return!1;var r=1;t=parseInt(t,10);var i,o=setInterval((function(){e.style.opacity=r,(r-=.1)<=.1&&(e.style.opacity="0",e.style.display="none","function"==typeof n&&n(),clearInterval(o))}),t>0?t/10:40)}function t_menuBase__fadeIn(e,t,n){if(!e)return!1;if(("1"===getComputedStyle(e).opacity||""===getComputedStyle(e).opacity)&&"none"!==getComputedStyle(e).display)return!1;var r=0,i=(t=parseInt(t,10))>0?t/10:40;e.style.opacity=r,e.style.display="block";var o=setInterval((function(){e.style.opacity=r,(r+=.1)>=1&&(e.style.opacity="1","function"==typeof n&&n(),clearInterval(o))}),i)}function t_menuBase__slideElement(e,t,n){var r="toTop"===n?0:t,i="toTop"===n?1:0,o=setInterval((function(){e.style.transform="translateY(-"+r+"px)",e.style.opacity=i.toString(),i="toTop"===n?i-.1:i+.1,r="toTop"===n?r+t/20:r-t/20,"toTop"===n&&r>=t&&(e.style.transform="translateY(-"+t+"px)",e.style.opacity="0",delete e.dataset.slideState,clearInterval(o)),"toBottom"===n&&r<=0&&(e.style.transform="",e.style.opacity="1",e.dataset.slideState="visible",clearInterval(o))}),10)}function t_menuBase__interactFromKeyboard(e){var t=document.getElementById("rec"+e);if(t){var n=t.querySelectorAll(".t-menu__list > li > a"),r=t.querySelectorAll(".t-menu__list > li li"),i=9,o=13,a=27,s=32,l=0,u,c=function e(t){t===n.length?t=0:t<0&&(t=n.length-1),n[t].focus(),l=t},d=function e(t,n){var r=t.querySelectorAll("a");n==r.length?n=0:n<0&&(n=r.length-1),r[n].focus(),u=n},f=function e(t){t.addEventListener("keydown",(function(e){var t=this.parentNode.querySelector(".t-menusub__list");switch(e.keyCode){case i:if(!e.shiftKey&&l<=n.length-2)c(l+1);else{if(!(e.shiftKey&&l>0))return;c(l-1)}break;case o:case s:if(!t)return;this.click(),u=0,d(t,0)}e.preventDefault()}))},m=function e(t){t.addEventListener("focus",(function(){u=0}))},_=function e(t){var n=t.parentNode.querySelector(".t-menusub__menu");t.addEventListener("click",(function(e){if("false"==this.getAttribute("aria-expanded")||null==this.getAttribute("aria-expanded")){this.setAttribute("aria-expanded","true");var r=t.nextElementSibling,i=r?r.getAttribute("data-submenu-margin"):0;t_menusub__showSubmenu(t,n,i)}else this.setAttribute("aria-expanded","false");var o=t.getAttribute("href");if(!o||""===o||"#"===o)return e.preventDefault(),!1}))},p=function e(t){var r=t.closest(".t-menusub__menu"),f=!1;t.addEventListener("keydown",(function(e){var t=this.parentNode;switch(e.keyCode){case i:f=!0;var m=t.querySelectorAll(".t-menusub__link-item").length;if(e.shiftKey)0===u?(c(l),t_menusub__hideSubmenu(r)):d(t,u-1);else if(u===m-1){if(t_menusub__hideSubmenu(r),l===n.length-1)return;c(l+1)}else d(t,u+1);break;case o:case s:f=!1,t_menusub__hideSubmenu(r);break;case a:f=!0,c(l),t_menusub__hideSubmenu(r)}f&&(e.preventDefault(),e.stopPropagation())}))};Array.prototype.forEach.call(n,(function(e){var t;m(e),f(e),!e.parentNode.querySelector(".t-menusub__menu")||window.isMobile||"ontouchend"in document||_(e)})),Array.prototype.forEach.call(r,(function(e){p(e)}))}}function t_menuBase__isBlockVisible(e){var t=window.innerWidth,n=e.getAttribute("data-screen-min"),r=e.getAttribute("data-screen-max");return!(n&&tparseInt(r,10))}