"use strict";(self.webpackChunk_brizy_builder_free=self.webpackChunk_brizy_builder_free||[]).push([["702"],{4901(e,t,r){r.r(t),r.d(t,{default:()=>b});var u=r(2540),n=r(1669),l=r.n(n);let o=e=>t=>t.elem.isEqualNode(e),a=e=>{let{elem:t,separator:r}=e,u=t.querySelector(".brz-counter-figures .brz-counter-numbers"),n=t.querySelector(".brz-counter-pie-chart");if(u){let t=e=>{u.textContent=e.toFixed(0).replace(/\B(?=(\d{3})+(?!\d))/g,r),n&&(n.style.strokeDasharray=`${e+.5} 100`)};l()({countNum:e.start}).animate({countNum:e.end},{duration:1e3*e.duration,easing:"linear",step:function(){t(this.countNum)},complete:function(){t(e.end)}})}},i=[],s=new IntersectionObserver(e=>{e.forEach(e=>{if(e.isIntersecting){let t=e.target,r=i.find(o(t)),u=i.findIndex(o(t));r&&-1!==u&&!i[u].wasAnimated&&(a(r),i[u].wasAnimated=!0)}})},{root:null,threshold:1});function b(e){let t=e.get(0);t&&(t.querySelectorAll(".brz-story").length>0?e.find(".brz-slick-slider").on("afterChange init",(e,t)=>{let{currentSlide:r,$slides:n}=t,l=n[r].querySelectorAll(".brz-counter");l.length&&l.forEach(e=>{var t,r,n,l;a({elem:e,start:Number(null!=(t=e.getAttribute((0,u.uo)("start")))?t:0),end:Number(null!=(r=e.getAttribute((0,u.uo)("end")))?r:100),duration:Number(null!=(n=e.getAttribute((0,u.uo)("duration")))?n:2),separator:null!=(l=e.getAttribute((0,u.uo)("separator")))?l:""})})}):t.querySelectorAll(".brz-counter").forEach(e=>{var t,r,n,l,o;o={elem:e,start:Number(null!=(t=e.getAttribute((0,u.uo)("start")))?t:0),end:Number(null!=(r=e.getAttribute((0,u.uo)("end")))?r:100),duration:Number(null!=(n=e.getAttribute((0,u.uo)("duration")))?n:2),separator:null!=(l=e.getAttribute((0,u.uo)("separator")))?l:"",wasAnimated:!1},i.push(o),s.observe(o.elem)}))}}}]);