"use strict";(self.webpackChunk_brizy_builder_free=self.webpackChunk_brizy_builder_free||[]).push([["265"],{816(e,t,l){l.r(t),l.d(t,{default:()=>o});var n=l(2540);let r=e=>new Promise(t=>{let{endLocation:l,duration:n,targetNode:r}=e;window.Brz.emit("elements.anchor.startScrolled",r);let i=document.scrollingElement;if(i){let e=i.scrollTop,r=0,o=()=>{let a,c,u="function"==typeof l?l():l;a=r+=20,c=u-e,i.scrollTop=(a/=n/2)<1?c/2*a*a+e:-c/2*(--a*(a-2)-1)+e,r<n?setTimeout(o,20):t()};o()}}),i=(e,t,l)=>{let n=e.querySelector(`[id="${t.slice(1)}"]`);return n&&l?n.getBoundingClientRect().top+l.scrollTop:0};function o(e){let t=e.get(0);if(!t)return;let l=t.ownerDocument.scrollingElement,o=e=>{e.preventDefault();let n=location.hash;(n&&t.querySelector(`[id="${n.slice(1)}"]`)||"#"===n)&&r({endLocation:()=>i(t,n,l),duration:600})};t.querySelectorAll(".brz-anchor, .link--anchor, .link--external").forEach(e=>{let l=e.getAttribute("href"),r=null==l?void 0:l.split("#")[1];if(!r||document.getElementById(r))return;let i=t.querySelector((0,n.pk)({name:"id",value:`'${r}'`}));if(i){let t=i.getAttribute("id");e.setAttribute("href",`#${t}`)}}),window.addEventListener("load",()=>{let e=window.location.hash.replace("#","");e&&document.getElementById(e)&&o(new Event("hashchange"))}),window.addEventListener("hashchange",o),t.addEventListener("click",e=>{if(e.target instanceof Element){let n=e.target.closest(".brz-a:not([data-brz-link-type='popup']), .brz-anchor, .link--anchor, .link--external, .brz-menu__ul a.menu-item");if(n){let o=n.hash.trim(),a=n.href.replace(o,""),c=o&&!!t.querySelector(`[id="${o.slice(1)}"]`);o&&((e,t)=>{let{href:l,hash:n}=t,r=l.replace(n,"");return r.includes(e)&&1>=Math.abs(r.length-e.length)})(a,location)&&(c||"#"===o)&&(e.preventDefault(),r({endLocation:()=>i(t,o,l),duration:600,targetNode:n}).then(()=>{history.pushState(null,"",o)}))}}})}}}]);