"use strict";(self.webpackChunkflow_web_extension=self.webpackChunkflow_web_extension||[]).push([["44232"],{339264:function(e,t){t.Z={"mic-container":"mic-container-enLqRD",micContainer:"mic-container-enLqRD","icon-mic":"icon-mic-KU01Be",iconMic:"icon-mic-KU01Be","mic-container-active":"mic-container-active-mTca8x",micContainerActive:"mic-container-active-mTca8x","close-container":"close-container-AQBAum",closeContainer:"close-container-AQBAum",close:"close-RIF6tD",bar:"bar-TQoPlw","bar-container":"bar-container-JRIEVA",barContainer:"bar-container-JRIEVA"}},59024:function(e,t,i){i.r(t),i.d(t,{default:()=>s});var n=i(397458),a=i(652983),r=i(87608),c=i.n(r),m=i(748931),o=i(861498),u=class{updateAnimateWithVolume(e,t,i,n){var a=!(arguments.length>4)||void 0===arguments[4]||arguments[4],r=(0,o.J4)(t*n,i),c=m.ki;if(null==e||e.forEach((e,i)=>{e&&(!t||t<=m.Y8?e.style.height="".concat(m.nJ,"px"):(e.style.height="".concat(r[i],"px"),e.style.opacity="".concat(c[i])))}),t<=m.Y8){this.animateTimer&&clearTimeout(this.animateTimer),a&&this.muteAnimateOnce(e,0,i,a);return}this.animateTimer&&clearTimeout(this.animateTimer),this.animateTimer=setTimeout(()=>this.updateAnimateWithVolume(e,t,i,n),100)}clearAnimateTimer(){this.animateTimer&&clearTimeout(this.animateTimer),this.muteAnimateTimer&&clearTimeout(this.muteAnimateTimer),this.animateTimer=null,this.muteAnimateTimer=null}constructor(){var e=this;this.animateTimer=null,this.muteAnimateTimer=null,this.muteAnimateOnce=function(t,i,n){var a=!(arguments.length>3)||void 0===arguments[3]||arguments[3],r=i;if(r<m.P5.length){var c=5*m.P5[r],u=(0,o.J4)(c,n);null==t||t.forEach((e,t)=>{e&&(e.style.height="".concat(u[t],"px"),e.style.opacity="".concat(m.ki[t]))}),r++,e.muteAnimateTimer&&clearTimeout(e.muteAnimateTimer),e.muteAnimateTimer=setTimeout(()=>a&&e.muteAnimateOnce(t,r,n,a),100)}else e.muteAnimateTimer&&clearTimeout(e.muteAnimateTimer),null==t||t.forEach(e=>{e&&(e.style.height="".concat(m.nJ,"px"))})}}},l=i(339264),s=e=>{var{count:t=7,volume:i=0,className:r="",delayAnimate:m=!0,barMaxHeight:o=0,idPrefix:s="",volumeScale:h=5}=e,T=(0,a.useRef)([]),v=(0,a.useRef)();(0,a.useEffect)(()=>(A(),v.current=new u,()=>{f()}),[]);var f=()=>{var e;null===(e=v.current)||void 0===e||e.clearAnimateTimer()},A=()=>{var e=Array.from({length:t},(e,t)=>document.getElementById("bar".concat(s).concat(t+1)));e.every(e=>null!==e)?T.current=e:requestAnimationFrame(A)};return(0,a.useEffect)(()=>{if(T.current.every(e=>null!==e)){var e;null===(e=v.current)||void 0===e||e.updateAnimateWithVolume(T.current,i||0,t,h,m)}},[i]),(0,n.jsx)("div",{className:c()(l.Z["bar-container"],r),style:o?{maxHeight:o}:{},children:Array.from({length:t},(e,t)=>(0,n.jsx)("div",{className:l.Z.bar,id:"bar".concat(s).concat(t+1)},t))})}},748931:function(e,t,i){i.d(t,{DS:()=>a,P5:()=>m,Y6:()=>r,Y8:()=>u,jv:()=>o,ki:()=>n,nJ:()=>c});var n=[.3,.6,.9,1,.9,.6,.3],a=20,r=1.2,c=4,m=[.01,.15,.1,.02,.07],o={1:[2],2:[0,6],3:[0,1,6],4:[0,1,5,6],5:[0,1,3,5,6],6:[0,1,2,4,5,6],7:[0,1,2,3,4,5,6]},u=.03},861498:function(e,t,i){i.d(t,{J4:()=>o,Kf:()=>r,_v:()=>a,xN:()=>c});var n=i(748931),a=e=>new Promise(t=>{setTimeout(t,e)}),r=e=>{for(var t=[],i=0;i<e.length/3;i+=1){var n=void 0;n=3*i+2>=e.length-1?e[3*i]:(e[3*i]+e[3*i+1]+e[3*i+2])/3,t.push(n)}return t},c=e=>0!==e,m=(e,t)=>Math.random()*(t-e)+e,o=(e,t)=>[2*n.Y6+e*m(.1,.3)*(n.DS-2),5*n.Y6+e*m(-.8,.6)*(n.DS-5),3*n.Y6+e*m(0,.6)*(n.DS-3),8*n.Y6+e*m(-1.6,1.2)*(n.DS-8),3*n.Y6+e*m(0,.6)*(n.DS-3),5*n.Y6+e*m(-.8,.6)*(n.DS-5),2*n.Y6+e*m(.1,.3)*(n.DS-2)].filter((e,i)=>n.jv[t.toString()].includes(i))}}]);
//# sourceMappingURL=lib-component-asr-animate.js.map