=0),D&&v.step[_]==ke)z!=0&&(d(z,p,ue,de,ie,he),z=0),i!=0&&(n(i,p,ue,de,ie,he),i=0);else{var ve=u.width[_];if(G+u.width[_]>u.max_nonzero_coeff){var ce;ce=u.max_nonzero_coeff-G+1,Qd.fill(f,u.max_nonzero_coeff,576,0),ve=ce,ve<0&&(ve=0),_=I+1}if(z==0&&i==0&&(ie=K,he=W,ue=m,de=g),v!=null&&v.sfb_count1>0&&_>=v.sfb_count1&&v.step[_]>0&&ke>=v.step[_]?(z!=0&&(d(z,p,ue,de,ie,he),z=0,ie=K,he=W,ue=m,de=g),i+=ve):(i!=0&&(n(i,p,ue,de,ie,he),i=0,ie=K,he=W,ue=m,de=g),z+=ve),ve<=0){i!=0&&(n(i,p,ue,de,ie,he),i=0),z!=0&&(d(z,p,ue,de,ie,he),z=0);break}}_<=I&&(W+=u.width[_],g+=u.width[_],G+=u.width[_])}z!=0&&(d(z,p,ue,de,ie,he),z=0),i!=0&&(n(i,p,ue,de,ie,he),i=0)}function S(m,f,p){var u=0,v=0;do{var _=m[f++],I=m[f++];u<_&&(u=_),v14&&(z=15,G+=I),z*=16),i!=0&&(i>14&&(i=15,G+=I),z+=i),G+=ee.largetbl[z]}while(f>=16,G>D&&(G=D,u=v),_.bits+=G,u}function L(m,f,p,u){var v=0,_=ee.ht[1].hlen;do{var I=m[f+0]*2+m[f+1];f+=2,v+=_[I]}while(f
>=16,_>I&&(_=I,u++),v.bits+=_,u}function E(m,f,p,u,v){var _=0,I=0,G=0,D=ee.ht[u].xlen,z=ee.ht[u].hlen,i=ee.ht[u+1].hlen,g=ee.ht[u+2].hlen;do{var K=m[f+0]*D+m[f+1];f+=2,_+=z[K],I+=i[K],G+=g[K]}while(f
I&&(_=I,W++),_>G&&(_=G,W=u+2),v.bits+=_,W}var h=[1,2,5,7,7,10,10,13,13,13,13,13,13,13,13];function R(m,f,p,u){var v=S(m,f,p);switch(v){case 0:return v;case 1:return L(m,f,p,u);case 2:case 3:return b(m,f,p,h[v-1],u);case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:return E(m,f,p,h[v-1],u);default:if(v>_t.IXMAX_VAL)return u.bits=_t.LARGE_BITS,-1;v-=15;var _;for(_=24;_<32&&!(ee.ht[_].linmax>=v);_++);var I;for(I=_-8;I<24&&!(ee.ht[I].linmax>=v);I++);return C(m,f,p,I,_,u)}}this.noquant_count_bits=function(m,f,p){var u=f.l3_enc,v=Math.min(576,f.max_nonzero_coeff+2>>1<<1);for(p!=null&&(p.sfb_count1=0);v>1&&(u[v-1]|u[v-2])==0;v-=2);f.count1=v;for(var _=0,I=0;v>3;v-=4){var G;if(((u[v-1]|u[v-2]|u[v-3]|u[v-4])&2147483647)>1)break;G=((u[v-4]*2+u[v-3])*2+u[v-2])*2+u[v-1],_+=ee.t32l[G],I+=ee.t33l[G]}var D=_;if(f.count1table_select=0,_>I&&(D=I,f.count1table_select=1),f.count1bits=D,f.big_values=v,v==0)return D;if(f.block_type==T.SHORT_TYPE)_=3*m.scalefac_band.s[3],_>f.big_values&&(_=f.big_values),I=f.big_values;else if(f.block_type==T.NORM_TYPE){if(_=f.region0_count=m.bv_scf[v-2],I=f.region1_count=m.bv_scf[v-1],I=m.scalefac_band.l[_+I+2],_=m.scalefac_band.l[_+1],II&&(_=I);if(_=Math.min(_,v),I=Math.min(I,v),_>0){var z=new t(D);f.table_select[0]=R(u,0,_,z),D=z.bits}if(__)return _t.LARGE_BITS;if(s(f,v,e.IPOW20(p.global_gain),p,u),(m.substep_shaping&2)!=0)for(var I=0,G=p.global_gain+p.scalefac_scale,D=.634521682242439/e.IPOW20(G),z=0;z=D?v[g]:0}}return this.noquant_count_bits(m,p,u)};function w(m,f,p,u,v,_,I){for(var G=f.big_values,D=0;D<=7+15;D++)u[D]=_t.LARGE_BITS;for(var D=0;D<16;D++){var z=m.scalefac_band.l[D+1];if(z>=G)break;var i=0,g=new t(i),K=R(p,0,z,g);i=g.bits;for(var W=0;W<8;W++){var ie=m.scalefac_band.l[D+W+2];if(ie>=G)break;var he=i;g=new t(he);var ue=R(p,z,ie,g);he=g.bits,u[D+W]>he&&(u[D+W]=he,v[D+W]=D,_[D+W]=K,I[D+W]=ue)}}}function o(m,f,p,u,v,_,I,G){for(var D=f.big_values,z=2;z=D)break;var g=v[z-2]+f.count1bits;if(p.part2_3_length<=g)break;var K=new t(g),W=R(u,i,D,K);g=K.bits,!(p.part2_3_length<=g)&&(p.assign(f),p.part2_3_length=g,p.region0_count=_[z-2],p.region1_count=z-2-_[z-2],p.table_select[0]=I[z-2],p.table_select[1]=G[z-2],p.table_select[2]=W)}}this.best_huffman_divide=function(m,f){var p=new to,u=f.l3_enc,v=gr(7+15+1),_=gr(7+15+1),I=gr(7+15+1),G=gr(7+15+1);if(!(f.block_type==T.SHORT_TYPE&&m.mode_gr==1)){p.assign(f),f.block_type==T.NORM_TYPE&&(w(m,f,u,v,_,I,G),o(m,p,f,u,v,_,I,G));var D=p.big_values;if(!(D==0||(u[D-2]|u[D-1])>1)&&(D=f.count1+2,!(D>576))){p.assign(f),p.count1=D;for(var z=0,i=0;D>p.big_values;D-=4){var g=((u[D-4]*2+u[D-3])*2+u[D-2])*2+u[D-1];z+=ee.t32l[g],i+=ee.t33l[g]}if(p.big_values=D,p.count1table_select=0,z>i&&(z=i,p.count1table_select=1),p.count1bits=z,p.block_type==T.NORM_TYPE)o(m,p,f,u,v,_,I,G);else{if(p.part2_3_length=z,z=m.scalefac_band.l[7+1],z>D&&(z=D),z>0){var K=new t(p.part2_3_length);p.table_select[0]=R(u,0,z,K),p.part2_3_length=K.bits}if(D>z){var K=new t(p.part2_3_length);p.table_select[1]=R(u,z,D,K),p.part2_3_length=K.bits}f.part2_3_length>p.part2_3_length&&f.assign(p)}}}};var F=[1,1,1,1,8,2,2,2,4,4,4,8,8,8,16,16],H=[1,2,4,8,1,2,4,8,2,4,8,2,4,8,4,8],j=[0,0,0,0,3,1,1,1,2,2,2,3,3,3,4,4],c=[0,1,2,3,0,1,2,3,1,2,3,1,2,3,2,3];br.slen1_tab=j,br.slen2_tab=c;function A(m,f){for(var p,u=f.tt[1][m],v=f.tt[0][m],_=0;_=0);p++);if(p==ee.scfsi_band[_+1]){for(p=ee.scfsi_band[_];pi&&(u.part2_length=i,u.scalefac_compress=_)}}this.best_scalefac_store=function(m,f,p,u){var v=u.tt[f][p],_,I,G,D,z=0;for(G=0,_=0;_0&&(g|=v.scalefac[_]);if((g&1)==0&&g!=0){for(_=0;_0&&(v.scalefac[_]>>=1);v.scalefac_scale=z=1}}if(v.preflag==0&&v.block_type!=T.SHORT_TYPE&&m.mode_gr==2){for(_=11;_0&&(v.scalefac[_]-=e.pretab[_]);v.preflag=z=1}}for(I=0;I<4;I++)u.scfsi[p][I]=0;for(m.mode_gr==2&&f==1&&u.tt[0][p].block_type!=T.SHORT_TYPE&&u.tt[1][p].block_type!=T.SHORT_TYPE&&(A(p,u),z=0),_=0;__[f]&&(m.part2_length=_[f],m.scalefac_compress=f);return m.part2_length==_t.LARGE_BITS};var x=[[15,15,7,7],[15,15,7,0],[7,3,0,0],[15,31,31,0],[7,7,7,0],[3,3,0,0]];this.scale_bitcount_lsf=function(m,f){var p,u,v,_,I,G,D,z,i=gr(4),g=f.scalefac;for(f.preflag!=0?p=2:p=0,D=0;D<4;D++)i[D]=0;if(f.block_type==T.SHORT_TYPE){u=1;var K=e.nr_of_sfb_block[p][u];for(z=0,v=0;v<4;v++)for(_=K[v]/3,D=0;D<_;D++,z++)for(I=0;I<3;I++)g[z*3+I]>i[v]&&(i[v]=g[z*3+I])}else{u=0;var K=e.nr_of_sfb_block[p][u];for(z=0,v=0;v<4;v++)for(_=K[v],D=0;D<_;D++,z++)g[z]>i[v]&&(i[v]=g[z])}for(G=!1,v=0;v<4;v++)i[v]>x[p][v]&&(G=!0);if(!G){var W,ie,he,ue;for(f.sfb_partition_table=e.nr_of_sfb_block[p][u],v=0;v<4;v++)f.slen[v]=y[i[v]];switch(W=f.slen[0],ie=f.slen[1],he=f.slen[2],ue=f.slen[3],p){case 0:f.scalefac_compress=(W*5+ie<<4)+(he<<2)+ue;break;case 1:f.scalefac_compress=400+(W*5+ie<<2)+he;break;case 2:f.scalefac_compress=500+W*3+ie;break;default:Wd.err.printf(`intensity stereo not implemented yet
-`);break}}if(!G)for(Ko(f.sfb_partition_table!=null),f.part2_length=0,v=0;v<4;v++)f.part2_length+=f.slen[v]*f.sfb_partition_table[v];return G};var y=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];this.huffman_init=function(m){for(var f=2;f<=576;f+=2){for(var p=0,u;m.scalefac_band.l[++p]f;)u--;for(u<0&&(u=a[p][0]),m.bv_scf[f-2]=u,u=a[p][1];m.scalefac_band.l[u+m.bv_scf[f-2]+2]>f;)u--;u<0&&(u=a[p][1]),m.bv_scf[f-1]=u}}}var Wt=fe.System,Jd=fe.Arrays,$d=fe.new_byte,em=fe.new_float_n,tm=fe.new_int,nt=fe.assert;jt.EQ=function(e,t){return Math.abs(e)>Math.abs(t)?Math.abs(e-t)<=Math.abs(e)*1e-6:Math.abs(e-t)<=Math.abs(t)*1e-6},jt.NEQ=function(e,t){return!jt.EQ(e,t)};function jt(){var e=this,t=32773,a=null,n=null,d=null,s=null;this.setModules=function(x,y,m,f){a=x,n=y,d=m,s=f};var S=null,C=0,L=0,b=0;this.getframebits=function(x){var y=x.internal_flags,m;y.bitrate_index!=0?m=ee.bitrate_table[x.version][y.bitrate_index]:m=x.brate;var f=0|(x.version+1)*72e3*m/x.out_samplerate+y.padding;return 8*f};function E(x){Wt.arraycopy(x.header[x.w_ptr].buf,0,S,L,x.sideinfo_len),L+=x.sideinfo_len,C+=x.sideinfo_len*8,x.w_ptr=x.w_ptr+1&je.MAX_HEADER_BUF-1}function h(x,y,m){for(;m>0;){var f;b==0&&(b=8,L++,nt(x.header[x.w_ptr].write_timing>=C),x.header[x.w_ptr].write_timing==C&&E(x),S[L]=0),f=Math.min(m,b),m-=f,b-=f,S[L]|=y>>m<0;){var f;b==0&&(b=8,L++,S[L]=0),f=Math.min(m,b),m-=f,b-=f,S[L]|=y>>m<=8&&(h(m,76,8),y-=8),y>=8&&(h(m,65,8),y-=8),y>=8&&(h(m,77,8),y-=8),y>=8&&(h(m,69,8),y-=8),y>=32){var p=d.getLameShortVersion();if(y>=32)for(f=0;f=8;++f)y-=8,h(m,p.charAt(f),8)}for(;y>=1;y-=1)h(m,m.ancillary_flag,1),m.ancillary_flag^=x.disable_reservoir?0:1}function o(x,y,m){for(var f=x.header[x.h_ptr].ptr;m>0;){var p=Math.min(m,8-(f&7));m-=p,x.header[x.h_ptr].buf[f>>3]|=y>>m<<8-(f&7)-p,f+=p}x.header[x.h_ptr].ptr=f}function F(x,y){x<<=8;for(var m=0;m<8;m++)x<<=1,y<<=1,((y^x)&65536)!=0&&(y^=t);return y}this.CRC_writeheader=function(x,y){var m=65535;m=F(y[2]&255,m),m=F(y[3]&255,m);for(var f=6;f>8),y[5]=byte(m&255)};function H(x,y){var m=x.internal_flags,f,p,u;if(f=m.l3_side,m.header[m.h_ptr].ptr=0,Jd.fill(m.header[m.h_ptr].buf,0,m.sideinfo_len,0),x.out_samplerate<16e3?o(m,4094,12):o(m,4095,12),o(m,x.version,1),o(m,4-3,2),o(m,x.error_protection?0:1,1),o(m,m.bitrate_index,4),o(m,m.samplerate_index,2),o(m,m.padding,1),o(m,x.extension,1),o(m,x.mode.ordinal(),2),o(m,m.mode_ext,2),o(m,x.copyright,1),o(m,x.original,1),o(m,x.emphasis,2),x.error_protection&&o(m,0,16),x.version==1){for(nt(f.main_data_begin>=0),o(m,f.main_data_begin,9),m.channels_out==2?o(m,f.private_bits,3):o(m,f.private_bits,5),u=0;u=0&&_.region0_count<16),nt(_.region1_count>=0&&_.region1_count<8),o(m,_.region0_count,4),o(m,_.region1_count,3)),o(m,_.preflag,1),o(m,_.scalefac_scale,1),o(m,_.count1table_select,1)}}else for(nt(f.main_data_begin>=0),o(m,f.main_data_begin,8),o(m,f.private_bits,m.channels_out),p=0,u=0;u=0&&_.region0_count<16),nt(_.region1_count>=0&&_.region1_count<8),o(m,_.region0_count,4),o(m,_.region1_count,3)),o(m,_.scalefac_scale,1),o(m,_.count1table_select,1)}x.error_protection&&CRC_writeheader(m,m.header[m.h_ptr].buf);{var I=m.h_ptr;nt(m.header[I].ptr==m.sideinfo_len*8),m.h_ptr=I+1&je.MAX_HEADER_BUF-1,m.header[m.h_ptr].write_timing=m.header[I].write_timing+y,m.h_ptr==m.w_ptr&&Wt.err.println(`Error: MAX_HEADER_BUF too small in bitstream.c
-`)}}function j(x,y){var m=ee.ht[y.count1table_select+32],f,p=0,u=y.big_values,v=y.big_values;for(nt(y.count1table_select<2),f=(y.count1-y.big_values)/4;f>0;--f){var _=0,I=0,G;G=y.l3_enc[u+0],G!=0&&(I+=8,y.xr[v+0]<0&&_++),G=y.l3_enc[u+1],G!=0&&(I+=4,_*=2,y.xr[v+1]<0&&_++),G=y.l3_enc[u+2],G!=0&&(I+=2,_*=2,y.xr[v+2]<0&&_++),G=y.l3_enc[u+3],G!=0&&(I++,_*=2,y.xr[v+3]<0&&_++),u+=4,v+=4,h(x,_+m.table[I],m.hlen[I]),p+=m.hlen[I]}return p}function c(x,y,m,f,p){var u=ee.ht[y],v=0;if(y==0)return v;for(var _=m;_15){if(g>14){var W=g-15;nt(W<=u.linmax),i|=W<<1,G=D,g=15}if(K>14){var ie=K-15;nt(ie<=u.linmax),i<<=D,i|=ie,G+=D,K=15}z=16}K!=0&&(i<<=1,p.xr[_+1]<0&&i++,I--),g=g*z+K,G-=I,I+=u.hlen[g],h(x,u.table[g],I),h(x,i,G),v+=I+G}return v}function A(x,y){var m=3*x.scalefac_band.s[3];m>y.big_values&&(m=y.big_values);var f=c(x,y.table_select[0],0,m,y);return f+=c(x,y.table_select[1],m,y.big_values,y),f}function N(x,y){var m,f,p,u;m=y.big_values;var v=y.region0_count+1;return nt(vm&&(p=m),u>m&&(u=m),f=c(x,y.table_select[0],0,p,y),f+=c(x,y.table_select[1],p,u,y),f+=c(x,y.table_select[2],u,m,y),f}function M(x){var y,m,f,p,u=0,v=x.internal_flags,_=v.l3_side;if(x.version==1)for(y=0;y<2;y++)for(m=0;m=0&&(p=1+v-_,v<_&&(p=1+v-_+je.MAX_HEADER_BUF),f-=p*8*m.sideinfo_len),u=e.getframebits(x),f+=u,y.total+=u,y.total%8!=0?y.total=1+y.total/8:y.total=y.total/8,y.total+=L+1,f<0&&Wt.err.println(`strange error flushing buffer ...
-`),f}this.flush_bitstream=function(x){var y=x.internal_flags,m,f,p=y.h_ptr-1;if(p==-1&&(p=je.MAX_HEADER_BUF-1),m=y.l3_side,!((f=l(x,new O))<0)){if(w(x,f),nt(y.header[p].write_timing+this.getframebits(x)==C),y.ResvSize=0,m.main_data_begin=0,y.findReplayGain){var u=a.GetTitleGain(y.rgdata);nt(NEQ(u,GainAnalysis.GAIN_NOT_ENOUGH_SAMPLES)),y.RadioGain=Math.floor(u*10+.5)|0}y.findPeakSample&&(y.noclipGainChange=Math.ceil(Math.log10(y.PeakSample/32767)*20*10)|0,y.noclipGainChange>0&&(EQ(x.scale,1)||EQ(x.scale,0))?y.noclipScale=Math.floor(32767/y.PeakSample*100)/100:y.noclipScale=-1)}},this.add_dummy_byte=function(x,y,m){for(var f=x.internal_flags,p;m-- >0;)for(R(f,y,8),p=0;p ResvSize"),m.main_data_begin*8!=y.ResvSize&&(Wt.err.printf(`bit reservoir error:
+ }`,n=document.createElement("style");n.textContent=e+t+s+a,this.$refs.emojiPicker.shadowRoot.appendChild(n)},openEmoji(e){this.$emit("open-emoji",!this.emojiOpened),this.setEmojiPickerPosition(e.clientY,e.view.innerWidth,e.view.innerHeight)},setEmojiPickerPosition(e,t,s){const a=t<500||s<700,n=document.querySelector("vue-advanced-chat").shadowRoot.getElementById("room-footer");if(!n){a&&(this.emojiPickerRight="-50px");return}a?(this.emojiPickerRight=t/2-(this.positionTop?200:150)+"px",this.emojiPickerTop=100,this.emojiPickerHeight=s-200):(n.getBoundingClientRect().top-e>this.emojiPickerHeight-50?this.emojiPickerTop=e+10:this.emojiPickerTop=e-this.emojiPickerHeight-10,this.emojiPickerRight=this.positionTop?"0px":this.positionRight?"60px":"")}}},g_={class:"vac-emoji-wrapper"},b_={ref:"emojiPicker","v-if":"emojiOpened"};function y_(e,t,s,a,n,r){const o=Ge("svg-icon");return Q(),ne("div",g_,[he("div",{class:at(["vac-svg-button",{"vac-emoji-reaction":s.emojiReaction}]),onClick:t[0]||(t[0]=(...u)=>r.openEmoji&&r.openEmoji(...u))},[Re(e.$slots,s.messageId?"emoji-picker-reaction-icon_"+s.messageId:"emoji-picker-icon",{},()=>[Oe(o,{name:"emoji",param:s.emojiReaction?"reaction":""},null,8,["param"])])],2),s.emojiOpened?(Q(),_t(Lt,{key:0,name:"vac-slide-up",appear:""},{default:Ke(()=>[he("div",{class:at(["vac-emoji-picker",{"vac-picker-reaction":s.emojiReaction}]),style:ft({height:`${n.emojiPickerHeight}px`,top:s.positionTop?n.emojiPickerHeight:`${n.emojiPickerTop}px`,right:n.emojiPickerRight,display:n.emojiPickerTop||!s.emojiReaction?"initial":"none"})},[he("emoji-picker",b_,null,512)],6)]),_:1})):Ce("",!0)])}var H1=St(p_,[["render",y_]]);const x_={name:"RoomFiles",components:{Loader:Dn,SvgIcon:Ut},props:{file:{type:Object,required:!0},index:{type:Number,required:!0}},emits:["remove-file"],computed:{isImage(){return ar(this.file)},isVideo(){return Kr(this.file)}}},w_={class:"vac-room-file-container"},S_=["src"],M_={class:"vac-text-ellipsis"},T_={key:0,class:"vac-text-ellipsis vac-text-extension"};function E_(e,t,s,a,n,r){const o=Ge("loader"),u=Ge("svg-icon");return Q(),ne("div",w_,[Oe(o,{show:s.file.loading,type:"room-file"},bt({_:2},[tt(e.$slots,(b,l)=>({name:l,fn:Ke(p=>[Re(e.$slots,l,gt(pt(p)))])}))]),1032,["show"]),he("div",{class:"vac-svg-button vac-icon-remove",onClick:t[0]||(t[0]=b=>e.$emit("remove-file",s.index))},[Re(e.$slots,"image-close-icon",{},()=>[Oe(u,{name:"close",param:"image"})])]),r.isImage?(Q(),ne("div",{key:0,class:at(["vac-message-image",{"vac-blur-loading":s.file.loading}]),style:ft({"background-image":`url('${s.file.localUrl||s.file.url}')`})},null,6)):r.isVideo?(Q(),ne("video",{key:1,controls:"",class:at({"vac-blur-loading":s.file.loading})},[he("source",{src:s.file.localUrl||s.file.url},null,8,S_)],2)):(Q(),ne("div",{key:2,class:at(["vac-file-container",{"vac-blur-loading":s.file.loading}])},[he("div",null,[Re(e.$slots,"file-icon",{},()=>[Oe(u,{name:"file"})])]),he("div",M_,Je(s.file.name),1),s.file.extension?(Q(),ne("div",T_,Je(s.file.extension),1)):Ce("",!0)],2))])}var A_=St(x_,[["render",E_]]);const k_={name:"RoomFiles",components:{SvgIcon:Ut,RoomFile:A_},props:{files:{type:Array,required:!0}},emits:["remove-file","reset-message"],computed:{footerHeight(){return document.querySelector("vue-advanced-chat").shadowRoot.getElementById("room-footer").clientHeight}}},R_={class:"vac-files-box"},O_={class:"vac-icon-close"};function I_(e,t,s,a,n,r){const o=Ge("room-file"),u=Ge("svg-icon");return Q(),_t(Lt,{name:"vac-slide-up"},{default:Ke(()=>[s.files.length?(Q(),ne("div",{key:0,class:"vac-room-files-container",style:ft({bottom:`${r.footerHeight}px`})},[he("div",R_,[(Q(!0),ne(ut,null,tt(s.files,(b,l)=>(Q(),ne("div",{key:l},[Oe(o,{file:b,index:l,onRemoveFile:t[0]||(t[0]=p=>e.$emit("remove-file",p))},bt({_:2},[tt(e.$slots,(p,c)=>({name:c,fn:Ke(M=>[Re(e.$slots,c,gt(pt(M)))])}))]),1032,["file","index"])]))),128))]),he("div",O_,[he("div",{class:"vac-svg-button",onClick:t[1]||(t[1]=b=>e.$emit("reset-message"))},[Re(e.$slots,"files-close-icon",{},()=>[Oe(u,{name:"close-outline"})])])])],4)):Ce("",!0)]),_:3})}var B_=St(k_,[["render",I_]]);const C_={props:{percentage:{type:Number,default:0},messageSelectionEnabled:{type:Boolean,required:!0}},emits:["hover-audio-progress","change-linehead"],data(){return{isMouseDown:!1}},methods:{onMouseDown(e){if(this.messageSelectionEnabled)return;this.isMouseDown=!0;const t=this.calculateLineHeadPosition(e,this.$refs.progress);this.$emit("change-linehead",t),document.addEventListener("mousemove",this.onMouseMove),document.addEventListener("mouseup",this.onMouseUp)},onMouseUp(e){if(this.messageSelectionEnabled)return;this.isMouseDown=!1,document.removeEventListener("mouseup",this.onMouseUp),document.removeEventListener("mousemove",this.onMouseMove);const t=this.calculateLineHeadPosition(e,this.$refs.progress);this.$emit("change-linehead",t)},onMouseMove(e){if(this.messageSelectionEnabled)return;const t=this.calculateLineHeadPosition(e,this.$refs.progress);this.$emit("change-linehead",t)},calculateLineHeadPosition(e,t){const s=t.getBoundingClientRect().width,a=t.getBoundingClientRect().left;let n=(e.clientX-a)/s;return n=n<0?0:n,n=n>1?1:n,n}}},L_={class:"vac-player-progress"},N_={class:"vac-line-container"};function j_(e,t,s,a,n,r){return Q(),ne("div",{ref:"progress",class:"vac-player-bar",onMousedown:t[0]||(t[0]=(...o)=>r.onMouseDown&&r.onMouseDown(...o)),onMouseover:t[1]||(t[1]=o=>e.$emit("hover-audio-progress",!0)),onMouseout:t[2]||(t[2]=o=>e.$emit("hover-audio-progress",!1))},[he("div",L_,[he("div",N_,[he("div",{class:"vac-line-progress",style:ft({width:`${s.percentage}%`})},null,4),he("div",{class:at(["vac-line-dot",{"vac-line-dot__active":n.isMouseDown}]),style:ft({left:`${s.percentage}%`})},null,6)])])],544)}var H_=St(C_,[["render",j_]]);const F_={name:"AudioPlayer",components:{SvgIcon:Ut,AudioControl:H_},props:{messageId:{type:[String,Number],default:null},src:{type:String,default:null},messageSelectionEnabled:{type:Boolean,required:!0}},emits:["hover-audio-progress","update-progress-time"],data(){return{isPlaying:!1,duration:this.convertTimeMMSS(0),playedTime:this.convertTimeMMSS(0),progress:0}},computed:{playerUniqId(){return`audio-player${this.messageId}`},audioSource(){return this.src?this.src:(this.resetProgress(),null)}},mounted(){this.player=document.querySelector("vue-advanced-chat").shadowRoot.getElementById(this.playerUniqId),this.player.addEventListener("ended",()=>{this.isPlaying=!1}),this.player.addEventListener("loadeddata",()=>{this.resetProgress(),this.duration=this.convertTimeMMSS(this.player.duration),this.updateProgressTime()}),this.player.addEventListener("timeupdate",this.onTimeUpdate)},methods:{convertTimeMMSS(e){return new Date(e*1e3).toISOString().substr(14,5)},playback(){this.messageSelectionEnabled||!this.audioSource||(this.isPlaying?this.player.pause():setTimeout(()=>this.player.play()),this.isPlaying=!this.isPlaying)},resetProgress(){this.isPlaying&&this.player.pause(),this.duration=this.convertTimeMMSS(0),this.playedTime=this.convertTimeMMSS(0),this.progress=0,this.isPlaying=!1,this.updateProgressTime()},onTimeUpdate(){this.playedTime=this.convertTimeMMSS(this.player.currentTime),this.progress=this.player.currentTime/this.player.duration*100,this.updateProgressTime()},onUpdateProgress(e){e&&(this.player.currentTime=e*this.player.duration)},updateProgressTime(){this.$emit("update-progress-time",this.progress>1?this.playedTime:this.duration)}}},P_={class:"vac-audio-player"},U_=["id","src"];function D_(e,t,s,a,n,r){const o=Ge("svg-icon"),u=Ge("audio-control");return Q(),ne("div",null,[he("div",P_,[he("div",{class:"vac-svg-button",onClick:t[0]||(t[0]=(...b)=>r.playback&&r.playback(...b))},[n.isPlaying?Re(e.$slots,"audio-pause-icon_"+s.messageId,{key:0},()=>[Oe(o,{name:"audio-pause"})]):Re(e.$slots,"audio-play-icon_"+s.messageId,{key:1},()=>[Oe(o,{name:"audio-play"})])]),Oe(u,{percentage:n.progress,"message-selection-enabled":s.messageSelectionEnabled,onChangeLinehead:r.onUpdateProgress,onHoverAudioProgress:t[1]||(t[1]=b=>e.$emit("hover-audio-progress",b))},null,8,["percentage","message-selection-enabled","onChangeLinehead"]),he("audio",{id:r.playerUniqId,src:r.audioSource},null,8,U_)])])}var sl=St(F_,[["render",D_]]);const q_={name:"RoomMessageReply",components:{SvgIcon:Ut,FormatMessage:Yr,AudioPlayer:sl},props:{room:{type:Object,required:!0},messageReply:{type:Object,default:null},textFormatting:{type:Object,required:!0},linkOptions:{type:Object,required:!0}},emits:["reset-message"],computed:{footerHeight(){return document.querySelector("vue-advanced-chat").shadowRoot.getElementById("room-footer").clientHeight},firstFile(){var e,t;return(t=(e=this.messageReply)==null?void 0:e.files)!=null&&t.length?this.messageReply.files[0]:{}},isImage(){return ar(this.firstFile)},isVideo(){return Kr(this.firstFile)},isAudio(){return Jn(this.firstFile)},isOtherFile(){var e,t;return((t=(e=this.messageReply)==null?void 0:e.files)==null?void 0:t.length)&&!this.isAudio&&!this.isVideo&&!this.isImage}}},V_={class:"vac-reply-box"},z_={class:"vac-reply-info"},Y_={class:"vac-reply-username"},X_={class:"vac-reply-content"},K_=["src"],G_={key:1,controls:"",class:"vac-image-reply"},Z_=["src"],W_={key:3,class:"vac-image-reply vac-file-container"},Q_={class:"vac-text-ellipsis"},J_={key:0,class:"vac-text-ellipsis vac-text-extension"},$_={class:"vac-icon-reply"};function ep(e,t,s,a,n,r){const o=Ge("format-message"),u=Ge("audio-player"),b=Ge("svg-icon");return Q(),_t(Lt,{name:"vac-slide-up"},{default:Ke(()=>[s.messageReply?(Q(),ne("div",{key:0,class:"vac-reply-container",style:ft({bottom:`${r.footerHeight}px`})},[he("div",V_,[he("div",z_,[he("div",Y_,Je(s.messageReply.username),1),he("div",X_,[Oe(o,{"message-id":s.messageReply._id,content:s.messageReply.content,users:s.room.users,"text-formatting":s.textFormatting,"link-options":s.linkOptions,reply:!0},null,8,["message-id","content","users","text-formatting","link-options"])])]),r.isImage?(Q(),ne("img",{key:0,src:r.firstFile.url,class:"vac-image-reply"},null,8,K_)):r.isVideo?(Q(),ne("video",G_,[he("source",{src:r.firstFile.url},null,8,Z_)])):r.isAudio?(Q(),_t(u,{key:2,src:r.firstFile.url,"message-selection-enabled":!1,class:"vac-audio-reply"},bt({_:2},[tt(e.$slots,(l,p)=>({name:p,fn:Ke(c=>[Re(e.$slots,p,gt(pt(c)))])}))]),1032,["src"])):r.isOtherFile?(Q(),ne("div",W_,[he("div",null,[Re(e.$slots,"file-icon",{},()=>[Oe(b,{name:"file"})])]),he("div",Q_,Je(r.firstFile.name),1),r.firstFile.extension?(Q(),ne("div",J_,Je(r.firstFile.extension),1)):Ce("",!0)])):Ce("",!0)]),he("div",$_,[he("div",{class:"vac-svg-button",onClick:t[0]||(t[0]=l=>e.$emit("reset-message"))},[Re(e.$slots,"reply-close-icon",{},()=>[Oe(b,{name:"close-outline"})])])])],4)):Ce("",!0)]),_:3})}var tp=St(q_,[["render",ep]]);const sp={name:"RoomUsersTag",props:{filteredUsersTag:{type:Array,required:!0},selectItem:{type:Boolean,default:null},activeUpOrDown:{type:Number,default:null}},emits:["select-user-tag","activate-item"],data(){return{activeItem:null}},computed:{footerHeight(){return document.querySelector("vue-advanced-chat").shadowRoot.getElementById("room-footer").clientHeight}},watch:{filteredUsersTag(e,t){(!t.length||e.length!==t.length)&&(this.activeItem=0)},selectItem(e){e&&this.$emit("select-user-tag",this.filteredUsersTag[this.activeItem])},activeUpOrDown(){this.activeUpOrDown>0&&this.activeItem0&&this.activeItem--,this.$emit("activate-item")}}},ap=["onMouseover","onClick"],rp={class:"vac-tags-info"},np={class:"vac-tags-username"};function ip(e,t,s,a,n,r){return Q(),_t(Lt,{name:"vac-slide-up"},{default:Ke(()=>[s.filteredUsersTag.length?(Q(),ne("div",{key:0,class:"vac-tags-container",style:ft({bottom:`${r.footerHeight}px`})},[(Q(!0),ne(ut,null,tt(s.filteredUsersTag,(o,u)=>(Q(),ne("div",{key:o._id,class:at(["vac-tags-box",{"vac-tags-box-active":u===n.activeItem}]),onMouseover:b=>n.activeItem=u,onClick:b=>e.$emit("select-user-tag",o)},[he("div",rp,[o.avatar?(Q(),ne("div",{key:0,class:"vac-avatar vac-tags-avatar",style:ft({"background-image":`url('${o.avatar}')`})},null,4)):Ce("",!0),he("div",np,Je(o.username),1)])],42,ap))),128))],4)):Ce("",!0)]),_:1})}var op=St(sp,[["render",ip]]);const lp={name:"RoomEmojis",props:{filteredEmojis:{type:Array,required:!0},selectItem:{type:Boolean,default:null},activeUpOrDown:{type:Number,default:null}},emits:["select-emoji","activate-item"],data(){return{activeItem:null}},computed:{footerHeight(){return document.querySelector("vue-advanced-chat").shadowRoot.getElementById("room-footer").clientHeight}},watch:{filteredEmojis(e,t){(!t.length||e.length!==t.length)&&(this.activeItem=0)},selectItem(e){e&&this.$emit("select-emoji",this.filteredEmojis[this.activeItem])},activeUpOrDown(){this.activeUpOrDown>0&&this.activeItem0&&this.activeItem--,this.$emit("activate-item")}}},cp=["onMouseover","onClick"];function up(e,t,s,a,n,r){return Q(),_t(Lt,{name:"vac-slide-up"},{default:Ke(()=>[s.filteredEmojis.length?(Q(),ne("div",{key:0,class:"vac-emojis-container",style:ft({bottom:`${r.footerHeight}px`})},[(Q(!0),ne(ut,null,tt(s.filteredEmojis,(o,u)=>(Q(),ne("div",{key:o,class:at(["vac-emoji-element",{"vac-emoji-element-active":u===n.activeItem}]),onMouseover:b=>n.activeItem=u,onClick:b=>e.$emit("select-emoji",o)},Je(o),43,cp))),128))],4)):Ce("",!0)]),_:1})}var dp=St(lp,[["render",up]]);const fp={name:"RoomTemplatesText",props:{filteredTemplatesText:{type:Array,required:!0},selectItem:{type:Boolean,default:null},activeUpOrDown:{type:Number,default:null}},emits:["select-template-text","activate-item"],data(){return{activeItem:null}},computed:{footerHeight(){return document.querySelector("vue-advanced-chat").shadowRoot.getElementById("room-footer").clientHeight}},watch:{filteredTemplatesText(e,t){(!t.length||e.length!==t.length)&&(this.activeItem=0)},selectItem(e){e&&this.$emit("select-template-text",this.filteredTemplatesText[this.activeItem])},activeUpOrDown(){this.activeUpOrDown>0&&this.activeItem0&&this.activeItem--,this.$emit("activate-item")}}},mp=["onMouseover","onClick"],hp={class:"vac-template-info"},vp={class:"vac-template-tag"},_p={class:"vac-template-text"};function pp(e,t,s,a,n,r){return Q(),_t(Lt,{name:"vac-slide-up"},{default:Ke(()=>[s.filteredTemplatesText.length?(Q(),ne("div",{key:0,class:"vac-template-container vac-app-box-shadow",style:ft({bottom:`${r.footerHeight}px`})},[(Q(!0),ne(ut,null,tt(s.filteredTemplatesText,(o,u)=>(Q(),ne("div",{key:u,class:at(["vac-template-box",{"vac-template-active":u===n.activeItem}]),onMouseover:b=>n.activeItem=u,onClick:b=>e.$emit("select-template-text",o)},[he("div",hp,[he("div",vp," /"+Je(o.tag),1),he("div",_p,Je(o.text),1)])],42,mp))),128))],4)):Ce("",!0)]),_:1})}var gp=St(fp,[["render",pp]]);function bp(e){return new Int8Array(e)}function F1(e){return new Int16Array(e)}function P1(e){return new Int32Array(e)}function U1(e){return new Float32Array(e)}function yp(e){return new Float64Array(e)}function D1(e){if(e.length==1)return U1(e[0]);var t=e[0];e=e.slice(1);for(var s=[],a=0;a=0;--w){var X,P;X=A[L+w]*o[20+w]+A[L+-1-w]*u[28+w],P=A[L+w]*u[28+w]-A[L+-1-w]*o[20+w],A[L+-1-w]=X,A[L+w]=P}}}if(H=i,C=286,M.mode_gr==1)for(var V=0;V<18;V++)wp.arraycopy(M.sb_sample[N][1][V],0,M.sb_sample[N][0][V],0,32)}}}var Ep=Ae.System,Ap=Ae.new_float,kp=Ae.new_float_n;function fi(){this.l=Ap(O.SBMAX_l),this.s=kp([O.SBMAX_s,3]);var e=this;this.assign=function(t){Ep.arraycopy(t.l,0,e.l,0,O.SBMAX_l);for(var s=0;s.03125)p.ATH.adjust>=1?p.ATH.adjust=1:p.ATH.adjust=T?(p.ATH.adjust*=T*.075+.925,p.ATH.adjust=T?p.ATH.adjust=T:p.ATH.adjust=0&&p.bitrate_index<16),hi(p.mode_ext>=0&&p.mode_ext<4),p.bitrate_stereoMode_Hist[p.bitrate_index][4]++,p.bitrate_stereoMode_Hist[15][4]++,p.channels_out==2&&(p.bitrate_stereoMode_Hist[p.bitrate_index][p.mode_ext]++,p.bitrate_stereoMode_Hist[15][p.mode_ext]++),c=0;c=O.BLKSIZE+p.framesize-O.FFTOFFSET),hi(M.mf_size>=512+p.framesize-32)}}this.lame_encode_mp3_frame=function(p,c,M,T,i,H){var C,N=G1([2,2]);N[0][0]=new fa,N[0][1]=new fa,N[1][0]=new fa,N[1][1]=new fa;var m=G1([2,2]);m[0][0]=new fa,m[0][1]=new fa,m[1][0]=new fa,m[1][1]=new fa;var R,B=[null,null],A=p.internal_flags,L=Rp([2,4]),f=[.5,.5],E=[[0,0],[0,0]],w=[[0,0],[0,0]],h,g,_;if(B[0]=c,B[1]=M,A.lame_encode_frame_init==0&&l(p,B),A.padding=0,(A.slot_lag-=A.frac_SpF)<0&&(A.slot_lag+=p.out_samplerate,A.padding=1),A.psymodel!=0){var v,x=[null,null],y=0,j=Op(2);for(_=0;_0&&(f[_]=L[_][3]/f[_])),g=0;g>1,C=l,N=l<<1,m=N+C,l=N<<1,p=o,c=p+R;do{var B,A,L,f;A=r[p+0]-r[p+C],B=r[p+0]+r[p+C],f=r[p+N]-r[p+m],L=r[p+N]+r[p+m],r[p+N]=B-L,r[p+0]=B+L,r[p+m]=A-f,r[p+C]=A+f,A=r[c+0]-r[c+C],B=r[c+0]+r[c+C],f=W1.SQRT2*r[c+m],L=W1.SQRT2*r[c+N],r[c+N]=B-L,r[c+0]=B+L,r[c+m]=A-f,r[c+C]=A+f,c+=l,p+=l}while(p=0);a(o[p],c,O.BLKSIZE_s/2)}},this.fft_long=function(r,o,u,b,l){var p=O.BLKSIZE/8-1,c=O.BLKSIZE/2;do{var M,T,i,H,C,N=n[p]&255;M=e[N]*b[u][l+N],C=e[N+512]*b[u][l+N+512],T=M-C,M=M+C,i=e[N+256]*b[u][l+N+256],C=e[N+768]*b[u][l+N+768],H=i-C,i=i+C,c-=4,o[c+0]=M+i,o[c+2]=M-i,o[c+1]=T+H,o[c+3]=T-H,M=e[N+1]*b[u][l+N+1],C=e[N+513]*b[u][l+N+513],T=M-C,M=M+C,i=e[N+257]*b[u][l+N+257],C=e[N+769]*b[u][l+N+769],H=i-C,i=i+C,o[c+O.BLKSIZE/2+0]=M+i,o[c+O.BLKSIZE/2+2]=M-i,o[c+O.BLKSIZE/2+1]=T+H,o[c+O.BLKSIZE/2+3]=T-H}while(--p>=0);a(o,c,O.BLKSIZE/2)},this.init_fft=function(r){for(var o=0;o=0;--ke){var ze=q[Y+0][ke],_e=q[Y+1][ke];q[Y+0][ke]=(ze+_e)*ts.SQRT2*.5,q[Y+1][ke]=(ze-_e)*ts.SQRT2*.5}for(var Ve=2;Ve>=0;--Ve)for(var ke=O.BLKSIZE_s-1;ke>=0;--ke){var ze=F[G+0][Ve][ke],_e=F[G+1][Ve][ke];F[G+0][Ve][ke]=(ze+_e)*ts.SQRT2*.5,F[G+1][Ve][ke]=(ze-_e)*ts.SQRT2*.5}}I[0]=q[Y+0][0],I[0]*=I[0];for(var ke=O.BLKSIZE/2-1;ke>=0;--ke){var ae=q[Y+0][O.BLKSIZE/2-ke],je=q[Y+0][O.BLKSIZE/2+ke];I[O.BLKSIZE/2-ke]=(ae*ae+je*je)*.5}for(var Ve=2;Ve>=0;--Ve){D[Ve][0]=F[G+0][Ve][0],D[Ve][0]*=D[Ve][0];for(var ke=O.BLKSIZE_s/2-1;ke>=0;--ke){var ae=F[G+0][Ve][O.BLKSIZE_s/2-ke],je=F[G+0][Ve][O.BLKSIZE_s/2+ke];D[Ve][O.BLKSIZE_s/2-ke]=(ae*ae+je*je)*.5}}{for(var $e=0,ke=11;kek)if(I=I*L)return k+I;G=k/I}if(k+=I,q+3<=3+3){if(G>=A)return k;var J=0|ts.FAST_LOG10_X(G,16);return k*g[J]}var J=0|ts.FAST_LOG10_X(G,16);if(F!=0?I=Y.ATH.cb_s[D]*Y.ATH.adjust:I=Y.ATH.cb_l[D]*Y.ATH.adjust,kI){var K,ie;return K=1,J<=13&&(K=_[J]),ie=ts.FAST_LOG10_X(k/I,10/15),k*((h[J]-K)*ie+K)}return J>13?k:k*_[J]}return k*h[J]}var x=[1.33352*1.33352,1.35879*1.35879,1.38454*1.38454,1.39497*1.39497,1.40548*1.40548,1.3537*1.3537,1.30382*1.30382,1.22321*1.22321,1.14758*1.14758,1];function y(k,I,D){var q;if(k<0&&(k=0),I<0&&(I=0),k<=0)return I;if(I<=0)return k;if(I>k?q=I/k:q=k/I,D>=-2&&D<=2){if(q>=A)return k+I;var Y=0|ts.FAST_LOG10_X(q,16);return(k+I)*x[Y]}return q1){for(var q=0;q1.58*k.thm[1].l[I]||k.thm[1].l[I]>1.58*k.thm[0].l[I])){var D=k.mld_l[I]*k.en[3].l[I],q=Math.max(k.thm[2].l[I],Math.min(k.thm[3].l[I],D));D=k.mld_l[I]*k.en[2].l[I];var Y=Math.max(k.thm[3].l[I],Math.min(k.thm[2].l[I],D));k.thm[2].l[I]=q,k.thm[3].l[I]=Y}for(var I=0;I1.58*k.thm[1].s[I][F]||k.thm[1].s[I][F]>1.58*k.thm[0].s[I][F])){var D=k.mld_s[I]*k.en[3].s[I][F],q=Math.max(k.thm[2].s[I][F],Math.min(k.thm[3].s[I][F],D));D=k.mld_s[I]*k.en[2].s[I][F];var Y=Math.max(k.thm[3].s[I][F],Math.min(k.thm[2].s[I][F],D));k.thm[2].s[I][F]=q,k.thm[3].s[I][F]=Y}}function P(k,I,D){var q=I,Y=Math.pow(10,D);I*=2,q*=2;for(var F=0;F=0),et(D[G]>=0),J+=I[G],K+=D[G],G++;if(k.en[q].s[F][Y]=J,k.thm[q].s[F][Y]=K,G>=ee){++F;break}et(I[G]>=0),et(D[G]>=0);{var ke=k.PSY.bo_s_weight[F],ze=1-ke;J=ke*I[G],K=ke*D[G],k.en[q].s[F][Y]+=J,k.thm[q].s[F][Y]+=K,J=ze*I[G],K=ze*D[G]}}for(;F=0),et(D[F]>=0),G+=I[F],J+=D[F],F++;if(k.en[q].l[Y]=G,k.thm[q].l[Y]=J,F>=ie){++Y;break}et(I[F]>=0),et(D[F]>=0);{var oe=k.PSY.bo_l_weight[Y],ke=1-oe;G=oe*I[F],J=oe*D[F],k.en[q].l[Y]+=G,k.thm[q].l[Y]+=J,G=ke*I[F],J=ke*D[F]}}for(;Y=0)}for(;K<=O.CBANDS;++K)D[K]=0,q[K]=0}function Z(k,I,D,q){var Y=k.internal_flags;k.short_blocks==cr.short_block_coupled&&!(I[0]!=0&&I[1]!=0)&&(I[0]=I[1]=0);for(var F=0;F=1?k:D<=0?I:I>0?Math.pow(k/I,D)*I:0}var de=[11.8,13.6,17.2,32,46.5,51.3,57.5,67.1,71.5,84.6,97.6,130];function Me(k,I){for(var D=309.07,q=0;q0){var G=F*I,J=k.en.s[q][Y];J>G&&(J>G*1e10?D+=de[q]*(10*t):D+=de[q]*ts.FAST_LOG10(J/G))}}return D}var Te=[6.8,5.8,5.8,6.4,6.5,9.9,12.1,14.4,15,18.9,21.6,26.9,34.2,40.2,46.8,56.5,60.7,73.9,85.7,93.4,126.1];function ve(k,I){for(var D=281.0575,q=0;q0){var F=Y*I,G=k.en.l[q];G>F&&(G>F*1e10?D+=Te[q]*(10*t):D+=Te[q]*ts.FAST_LOG10(G/F))}}return D}function Ue(k,I,D,q,Y){var F,G;for(F=G=0;F=0),et(D[F]>=0),et(q[F]>=0),et(Y[F]>=0)}}function Le(k,I,D,q){var Y=E.length-1,F=0,G=D[F]+D[F+1];if(G>0){var J=I[F];J0),G=20*(J*2-G)/(G*(k.numlines_l[F]+k.numlines_l[F+1]-1));var K=0|G;K>Y&&(K=Y),q[F]=K}else q[F]=0;for(F=1;F0){var J=I[F-1];J0),G=20*(J*3-G)/(G*(k.numlines_l[F-1]+k.numlines_l[F]+k.numlines_l[F+1]-1));var K=0|G;K>Y&&(K=Y),q[F]=K}else q[F]=0;if(et(F==k.npart_l-1),G=D[F-1]+D[F],G>0){var J=I[F-1];J0),G=20*(J*2-G)/(G*(k.numlines_l[F-1]+k.numlines_l[F]-1));var K=0|G;K>Y&&(K=Y),q[F]=K}else q[F]=0;et(F==k.npart_l-1)}var fe=[-865163e-23*2,-.00851586*2,-674764e-23*2,.0209036*2,-336639e-22*2,-.0438162*2,-154175e-22*2,.0931738*2,-552212e-22*2,-.313819*2];this.L3psycho_anal_ns=function(k,I,D,q,Y,F,G,J,K,ie){var ee=k.internal_flags,oe=ps([2,O.BLKSIZE]),ke=ps([2,3,O.BLKSIZE_s]),ze=jt(O.CBANDS+1),_e=jt(O.CBANDS+1),Ve=jt(O.CBANDS+2),ae=Na(2),je=Na(2),$e,pe,He,ge,Ye,At,Be,We,st=ps([2,576]),kt,us=Na(O.CBANDS+2),Nt=Na(O.CBANDS+2);for(Bp.fill(Nt,0),$e=ee.channels_out,k.mode==mt.JOINT_STEREO&&($e=4),k.VBR==lr.vbr_off?kt=ee.ResvMax==0?0:ee.ResvSize/ee.ResvMax*.5:k.VBR==lr.vbr_rh||k.VBR==lr.vbr_mtrh||k.VBR==lr.vbr_mt?kt=.6:kt=1,pe=0;pe2&&(F[q][pe].en.assign(ee.en[pe+2]),F[q][pe].thm.assign(ee.thm[pe+2]))}for(pe=0;pe<$e;pe++){var Es,As,Xt=jt(12),Us=[0,0,0,0],fr=jt(12),fl=1,vu,_u=jt(O.CBANDS),pu=jt(O.CBANDS),Ot=[0,0,0,0],gu=jt(O.HBLKSIZE),bu=ps([3,O.HBLKSIZE_s]);for(et(ee.npart_s<=O.CBANDS),et(ee.npart_l<=O.CBANDS),ge=0;ge<3;ge++)Xt[ge]=ee.nsPsy.last_en_subshort[pe][ge+6],et(ee.nsPsy.last_en_subshort[pe][ge+4]>0),fr[ge]=Xt[ge]/ee.nsPsy.last_en_subshort[pe][ge+4],Us[0]+=Xt[ge];if(pe==2)for(ge=0;ge<576;ge++){var ml,hl;ml=st[0][ge],hl=st[1][ge],st[0][ge]=ml+hl,st[1][ge]=ml-hl}{var yu=st[pe&1],un=0;for(ge=0;ge<9;ge++){for(var f4=un+64,Pt=1;unXt[ge+3-2]?(et(Xt[ge+3-2]>0),Pt=Pt/Xt[ge+3-2]):Xt[ge+3-2]>Pt*10?Pt=Xt[ge+3-2]/(Pt*10):Pt=0,fr[ge+3]=Pt}}if(k.analysis){var vl=fr[0];for(ge=1;ge<12;ge++)vlvu&&(Ot[ge/3]=ge%3+1);for(ge=1;ge<4;ge++){var _l;Us[ge-1]>Us[ge]?(et(Us[ge]>0),_l=Us[ge-1]/Us[ge]):(et(Us[ge-1]>0),_l=Us[ge]/Us[ge-1]),_l<1.7&&(Ot[ge]=0,ge==1&&(Ot[0]=0))}for(Ot[0]!=0&&ee.nsPsy.lastAttacks[pe]!=0&&(Ot[0]=0),(ee.nsPsy.lastAttacks[pe]==3||Ot[0]+Ot[1]+Ot[2]+Ot[3]!=0)&&(fl=0,Ot[1]!=0&&Ot[0]!=0&&(Ot[1]=0),Ot[2]!=0&&Ot[1]!=0&&(Ot[2]=0),Ot[3]!=0&&Ot[2]!=0&&(Ot[3]=0)),pe<2?je[pe]=fl:fl==0&&(je[0]=je[1]=0),K[pe]=ee.tot_ener[pe],As=ke,Es=oe,N(k,gu,bu,Es,pe&1,As,pe&1,q,pe,I,D),Ue(ee,gu,ze,_u,pu),Le(ee,_u,pu,us),We=0;We<3;We++){var pl,rs;for(S(k,bu,_e,Ve,pe,We),V(ee,_e,Ve,pe,We),Be=0;Be=2||Ot[We+1]==1){var dn=We!=0?We-1:2,Pt=W(ee.thm[pe].s[Be][dn],rs,p*kt);rs=Math.min(rs,Pt)}if(Ot[We]==1){var dn=We!=0?We-1:2,Pt=W(ee.thm[pe].s[Be][dn],rs,c*kt);rs=Math.min(rs,Pt)}else if(We!=0&&Ot[We-1]==3||We==0&&ee.nsPsy.lastAttacks[pe]==3){var dn=We!=2?We+1:0,Pt=W(ee.thm[pe].s[Be][dn],rs,c*kt);rs=Math.min(rs,Pt)}pl=Xt[We*3+3]+Xt[We*3+4]+Xt[We*3+5],Xt[We*3+5]*60&&j(k,k.interChRatio),k.mode==mt.JOINT_STEREO){var bl;X(ee),bl=k.msfix,Math.abs(bl)>0&&P(ee,bl,k.ATHlower*ee.ATH.adjust)}for(Z(k,je,ie,ae),pe=0;pe<$e;pe++){var fn,mn=0,wi,Si;pe>1?(fn=J,mn=-2,wi=O.NORM_TYPE,(ie[0]==O.SHORT_TYPE||ie[1]==O.SHORT_TYPE)&&(wi=O.SHORT_TYPE),Si=F[q][pe-2]):(fn=G,mn=0,wi=ie[pe],Si=Y[q][pe]),wi==O.SHORT_TYPE?fn[mn+pe]=Me(Si,ee.masking_lower):fn[mn+pe]=ve(Si,ee.masking_lower),k.analysis&&(ee.pinfo.pe[q][pe]=fn[mn+pe])}return 0};function Xe(k,I,D,q,Y,F,G,J){var K=k.internal_flags;if(q<2)e.fft_long(K,G[J],q,I,D);else if(q==2)for(var ie=O.BLKSIZE-1;ie>=0;--ie){var ee=G[J+0][ie],oe=G[J+1][ie];G[J+0][ie]=(ee+oe)*ts.SQRT2*.5,G[J+1][ie]=(ee-oe)*ts.SQRT2*.5}F[0]=G[J+0][0],F[0]*=F[0];for(var ie=O.BLKSIZE/2-1;ie>=0;--ie){var ke=G[J+0][O.BLKSIZE/2-ie],ze=G[J+0][O.BLKSIZE/2+ie];F[O.BLKSIZE/2-ie]=(ke*ke+ze*ze)*.5}{for(var _e=0,ie=11;ie=0;--ie){var ee=G[J+0][Y][ie],oe=G[J+1][Y][ie];G[J+0][Y][ie]=(ee+oe)*ts.SQRT2*.5,G[J+1][Y][ie]=(ee-oe)*ts.SQRT2*.5}F[Y][0]=G[J+0][Y][0],F[Y][0]*=F[Y][0];for(var ie=O.BLKSIZE_s/2-1;ie>=0;--ie){var ke=G[J+0][Y][O.BLKSIZE_s/2-ie],ze=G[J+0][Y][O.BLKSIZE_s/2+ie];F[Y][O.BLKSIZE_s/2-ie]=(ke*ke+ze*ze)*.5}}function U(k,I,D,q){var Y=k.internal_flags;k.athaa_loudapprox==2&&D<2&&(Y.loudness_sq[I][D]=Y.loudness_sq_save[D],Y.loudness_sq_save[D]=C(q,Y))}var z=[-865163e-23*2,-.00851586*2,-674764e-23*2,.0209036*2,-336639e-22*2,-.0438162*2,-154175e-22*2,.0931738*2,-552212e-22*2,-.313819*2];function te(k,I,D,q,Y,F,G,J,K,ie){for(var ee=ps([2,576]),oe=k.internal_flags,ke=oe.channels_out,ze=k.mode==mt.JOINT_STEREO?4:ke,_e=0;_e2&&(F[q][_e].en.assign(oe.en[_e+2]),F[q][_e].thm.assign(oe.thm[_e+2]))}for(var _e=0;_e0;++ae,--pe){var kt=ee[0][ae],us=ee[1][ae];ee[0][ae]=kt+us,ee[1][ae]=kt-us}for(var ae=0;ae<3;ae++)ge[ae]=oe.nsPsy.last_en_subshort[_e][ae+6],et(oe.nsPsy.last_en_subshort[_e][ae+4]>0),He[ae]=ge[ae]/oe.nsPsy.last_en_subshort[_e][ae+4],Ye[0]+=ge[ae];for(var ae=0;ae<9;ae++){for(var Nt=Be+64,Rt=1;Bege[ae+3-2]?(et(ge[ae+3-2]>0),Rt=Rt/ge[ae+3-2]):ge[ae+3-2]>Rt*10?Rt=ge[ae+3-2]/(Rt*10):Rt=0,He[ae+3]=Rt}for(var ae=0;ae<3;++ae){var as=ge[ae*3+3]+ge[ae*3+4]+ge[ae*3+5],ds=1;ge[ae*3+5]*6We&&(K[_e][ae/3]=ae%3+1);for(var ae=1;ae<4;ae++){var Es=Ye[ae-1],As=Ye[ae],Xt=Math.max(Es,As);Xt<4e4&&Es<1.7*As&&As<1.7*Es&&(ae==1&&K[_e][0]<=K[_e][ae]&&(K[_e][0]=0),K[_e][ae]=0)}K[_e][0]<=oe.nsPsy.lastAttacks[_e]&&(K[_e][0]=0),(oe.nsPsy.lastAttacks[_e]==3||K[_e][0]+K[_e][1]+K[_e][2]+K[_e][3]!=0)&&(st=0,K[_e][1]!=0&&K[_e][0]!=0&&(K[_e][1]=0),K[_e][2]!=0&&K[_e][1]!=0&&(K[_e][2]=0),K[_e][3]!=0&&K[_e][2]!=0&&(K[_e][3]=0)),_e<2?ie[_e]=st:st==0&&(ie[0]=ie[1]=0),G[_e]=oe.tot_ener[_e]}}function le(k,I,D){if(D==0)for(var q=0;q0){var J=I[F];J0),G=20*(J*2-G)/(G*(k.numlines_s[F]+k.numlines_s[F+1]-1));var K=0|G;K>Y&&(K=Y),q[F]=K}else q[F]=0;for(F=1;F0){var J=I[F-1];J0),G=20*(J*3-G)/(G*(k.numlines_s[F-1]+k.numlines_s[F]+k.numlines_s[F+1]-1));var K=0|G;K>Y&&(K=Y),q[F]=K}else q[F]=0;if(et(F==k.npart_s-1),G=D[F-1]+D[F],G>0){var J=I[F-1];J0),G=20*(J*2-G)/(G*(k.numlines_s[F-1]+k.numlines_s[F]-1));var K=0|G;K>Y&&(K=Y),q[F]=K}else q[F]=0;et(F==k.npart_s-1)}function Ee(k,I,D,q,Y,F){var G=k.internal_flags,J=new float[O.CBANDS],K=jt(O.CBANDS),ie,ee,oe,ke=new int[O.CBANDS];for(oe=ee=0;oe=0)}for(et(oe==G.npart_s);oege&&(q[oe]=ge),G.masking_lower>1&&(q[oe]*=G.masking_lower),q[oe]>D[oe]&&(q[oe]=D[oe]),G.masking_lower<1&&(q[oe]*=G.masking_lower),et(q[oe]>=0)}for(;oe0?q[K]=Math.min(oe,$e):q[K]=Math.min(oe,D[K]*c)}else{var pe=a*k.nb_2[Y][K],He=s*k.nb_1[Y][K],$e;pe<=0&&(pe=oe),He<=0&&(He=oe),k.blocktype_old[Y&1]==O.NORM_TYPE?$e=Math.min(He,pe):$e=He,q[K]=Math.min(oe,$e)}k.nb_2[Y][K]=k.nb_1[Y][K],k.nb_1[Y][K]=oe,ee=F[K],ee*=k.minval_l[K],ee*=ke,q[K]>ee&&(q[K]=ee),k.masking_lower>1&&(q[K]*=k.masking_lower),q[K]>D[K]&&(q[K]=D[K]),k.masking_lower<1&&(q[K]*=k.masking_lower),et(q[K]>=0)}for(;K